/* Sign-up page. Builds on landing.css (header, footer, buttons, .lp-field). */

/*
 | One wide, compact card: three columns on a desktop, two on a tablet, one on a
 | phone. Everything is sized from a handful of values here so the fields line
 | up row after row.
 */
.rg-page {
    --rg-h: 40px;
    --rg-radius: 8px;
    --rg-border: #d9d9de;
    --rg-ring: rgba(194, 65, 12, .16);
    padding: 14px 16px 28px;
}

.rg-card {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 18px 28px 14px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 14px 36px rgba(0, 0, 0, .06);
}

.rg-head { text-align: center; margin-bottom: 12px; }

/* The wide logo, centred over the heading; it links home. */
.rg-logo { display: block; width: max-content; max-width: 100%; margin: 0 auto 8px; }
.rg-logo img { display: block; width: auto; height: 36px; max-width: 100%; object-fit: contain; }
.rg-head h1 { margin: 0 0 4px; font-size: var(--ui-fs-page); font-weight: var(--ui-fw-semibold); letter-spacing: -.02em; line-height: 1.25; }
.rg-head p { margin: 0; font-size: 13px; }

.rg-form { display: grid; gap: 12px; }

.rg-page .field { position: relative; }

.rg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: start;
}

.rg-field-wide { grid-column: 1 / -1; }
/* The PIN code and the location share a row: the PIN takes one column, the location two. */
.rg-location { grid-column: span 2; }
.rg-field-pin { align-self: end; }

/* Same type as the captions over Plan and Billing, so the three boxes line up exactly. */
.rg-label-spacer { display: block; visibility: hidden; margin: 0 0 4px; font-size: 12.5px; font-weight: 600; }
.rg-field-address { grid-column: span 2; }

/* ------------------------------------------------------------- fields */

/* Text boxes carry their name as the placeholder; the label stays for screen readers. */
.rg-card .lp-field label.rg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.rg-card .lp-field label {
    display: block;
    margin: 0 0 4px;
    color: #3a3a3f;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .005em;
}

.rg-card .lp-field input,
.rg-card .lp-field select {
    width: 100%;
    height: var(--rg-h);
    /* landing.css gives every field a 48px minimum; the compact height wins here. */
    min-height: var(--rg-h);
    padding: 0 13px;
    background-color: #fff;
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius);
    color: var(--lp-text);
    font: inherit;
    font-size: 14px;
    transition: border-color .15s var(--lp-ease), box-shadow .15s var(--lp-ease), background-color .15s var(--lp-ease);
}

.rg-card .lp-field input::placeholder { color: #8a8a93; font-size: 14px; letter-spacing: 0; opacity: 1; }

@media (hover: hover) and (pointer: fine) {
    .rg-card .lp-field input:not([type="checkbox"]):not([readonly]):hover,
    .rg-card .lp-field select:hover { border-color: #b4b4bd; }
}

.rg-card .lp-field input:focus-visible,
.rg-card .lp-field select:focus-visible {
    outline: none;
    border-color: var(--lp-brand);
    box-shadow: 0 0 0 3px var(--rg-ring);
}

.rg-card .lp-field input[readonly] { background-color: var(--lp-bg-alt); color: var(--lp-muted); cursor: default; }
.rg-card .lp-field select.is-invalid,
.rg-card .lp-field input.is-invalid { border-color: #c4262e; }

/* The native arrow is replaced by one drawn here, so the control reads the same
   in every browser and sits where the text's own padding leaves room for it. */
.rg-card .lp-field select {
    padding-right: 32px;
    font-size: 14px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.rg-optional { color: var(--lp-muted); font-size: 12px; font-weight: 400; }

.rg-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--lp-muted); line-height: 1.4; }
.rg-hint[hidden] { display: none; }

/* The chosen plan's one line, right-aligned on the label's own line. */
.rg-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; margin: 0 0 4px; }
.rg-card .lp-field .rg-label-row label { margin: 0; flex: none; }
.rg-label-row .rg-hint[data-plan-blurb] {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8a3411;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.rg-error { display: block; margin-top: 5px; font-size: 12.5px; color: #c4262e; }
.rg-summary { margin: 0 0 16px; padding: 11px 16px 11px 32px; border-radius: 12px; background: rgba(196, 38, 46, .09); color: #c4262e; font-size: 14px; }

/* ------------------------------------------------- billing, as a switch */

/* register.js turns the Billing select into this and hides the select; without
   JavaScript the select is simply the control. */
.rg-card .lp-field select.rg-seg-source {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.rg-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    height: var(--rg-h);
    padding: 4px;
    background: var(--lp-bg-alt);
    border: 1px solid var(--lp-line);
    border-radius: 12px;
}

.rg-seg button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--lp-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s var(--lp-ease), color .15s var(--lp-ease), box-shadow .15s var(--lp-ease);
}

@media (hover: hover) and (pointer: fine) { .rg-seg button:hover { color: var(--lp-text); } }
.rg-seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--rg-ring); }
.rg-seg button[aria-checked="true"] { background: #fff; color: var(--lp-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

.rg-seg-tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(48, 164, 108, .14);
    color: #1f7a4d;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ----------------------------------------------------- location, logo */

.rg-location-controls { display: flex; gap: 10px; }
.rg-card .rg-location-controls input { min-width: 0; flex: 1; }
.rg-location-button {
    width: var(--rg-h);
    min-height: var(--rg-h);
    padding: 0;
    flex: none;
    display: inline-grid;
    place-items: center;
    border-radius: var(--rg-radius);
    color: var(--lp-text);
}

.rg-location-button:disabled { cursor: progress; opacity: .6; }

/* The file box, as a drop area. */
.rg-card .lp-field input[type="file"] {
    height: auto;
    min-height: 42px;
    padding: 8px 10px;
    background: #fafafb;
    border: 1.5px dashed #c6c6ce;
    color: var(--lp-muted);
    font-size: 14px;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .rg-card .lp-field input[type="file"]:hover { border-color: var(--lp-brand); background: rgba(194, 65, 12, .04); }
}

.rg-card .lp-field input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: 1px solid var(--rg-border);
    border-radius: 8px;
    background: #fff;
    color: var(--lp-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s var(--lp-ease), color .15s var(--lp-ease);
}

@media (hover: hover) and (pointer: fine) {
    .rg-card .lp-field input[type="file"]::file-selector-button:hover { border-color: var(--lp-brand); color: var(--lp-brand); }
}

/* ------------------------------------------------------------- phone */

/* The +91 sits inside the box, to the left. */
.rg-phone { display: flex; align-items: stretch; position: relative; }

.rg-prefix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: var(--lp-bg-alt);
    border: 1px solid var(--rg-border);
    border-right: 0;
    border-radius: var(--rg-radius) 0 0 var(--rg-radius);
    font-size: 14px;
    color: var(--lp-text);
    white-space: nowrap;
}

.rg-flag { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }

.rg-card .rg-phone input { border-radius: 0 var(--rg-radius) var(--rg-radius) 0; min-width: 0; }

/* ---------------------------------------------------------- password */

/* The eye is a grey segment joined to the box (app.js data-toggle-password + data-toggle-icon). */
.rg-password { display: flex; align-items: stretch; }
.rg-card .rg-password input { flex: 1; min-width: 0; border-radius: var(--rg-radius) 0 0 var(--rg-radius); }

.rg-reveal {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: var(--rg-h);
    padding: 0;
    border: 1px solid var(--rg-border);
    border-left: 0;
    border-radius: 0 var(--rg-radius) var(--rg-radius) 0;
    background: #eceef1;
    color: #5b5b63;
    cursor: pointer;
    transition: color .15s var(--lp-ease), background-color .15s var(--lp-ease);
}

@media (hover: hover) and (pointer: fine) { .rg-reveal:hover { color: var(--lp-text); background: #e2e5e9; } }
.rg-reveal:focus-visible { outline: none; color: var(--lp-text); box-shadow: 0 0 0 3px var(--rg-ring); }

.rg-eye-off { display: none; }
.rg-reveal.is-revealed .rg-eye { display: none; }
.rg-reveal.is-revealed .rg-eye-off { display: block; }

/* ------------------------------------------------------------- terms */

/* Beside the password: its box is as tall as the password's, and it sits level with it. */
.rg-terms-cell { grid-column: span 2; align-self: end; }

.rg-terms {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--rg-h);
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}

.rg-terms input { width: 18px; height: 18px; flex: none; accent-color: var(--lp-brand); }
.rg-terms a { color: var(--lp-text); font-weight: 600; text-underline-offset: 2px; }

/* ------------------------------------------------------------ submit */

.rg-submit {
    width: min(320px, 100%);
    min-height: var(--ui-btn-h-lg);
    justify-self: center;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: var(--ui-radius-btn);
    transition: transform .15s var(--lp-ease), box-shadow .15s var(--lp-ease), opacity .15s var(--lp-ease);
}

@media (hover: hover) and (pointer: fine) {
    .rg-submit:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(194, 65, 12, .28); }
}

.rg-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--rg-ring); }

.rg-foot {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--lp-line);
    text-align: center;
    font-size: 14px;
    color: var(--lp-muted);
}

.rg-foot a { color: var(--lp-brand); font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .rg-foot a:hover { text-decoration: underline; text-underline-offset: 2px; } }

/* A field that passed after failing: a quiet confirmation, not a celebration. */
.lp-field input.is-valid { border-color: #30a46c; }

/* ------------------------------------------------------------ tablet */

/* Two columns once the card is too narrow for three comfortable ones. */
@media (max-width: 760px) {
    .rg-card { padding: 18px 22px 14px; }
    .rg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Plan | Billing on the first row, then the business name on a row of its own. */
    .rg-field-business { grid-column: 1 / -1; }
    .rg-label-spacer { display: none; }
}

/* ------------------------------------------------------------- phone */

@media (max-width: 640px) {
    .rg-page { padding: 14px 10px 32px; }
    .rg-card { padding: 20px 16px 16px; }
    .rg-head { margin-bottom: 16px; }
    .rg-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .rg-field-wide,
    .rg-location,
    .rg-field-address,
    .rg-field-business,
    .rg-terms-cell { grid-column: auto; }

    /* 16px, so iOS does not zoom the page when a field takes focus. */
    .rg-card .lp-field input,
    .rg-card .lp-field select { font-size: 16px; }
    .rg-card .lp-field input::placeholder { font-size: 14px; }

    /* Full-width controls. */
    .rg-submit { width: 100%; }
    .rg-terms-cell { align-self: stretch; }
}

/* ------------------------------------------- email one-time code */

.rg-otp { grid-column: 1 / -1; margin: 0; }
.rg-otp .rg-otp-send { width: 100%; }
@media (min-width: 761px) {
    .rg-otp .rg-otp-send { width: auto; min-width: 240px; }
    .rg-otp-panel { max-width: 420px; }
}
.rg-otp-panel[hidden], .rg-otp-send[hidden], .rg-otp-msg[hidden], .rg-gate[hidden], .rg-submit[hidden] { display: none; }
.rg-otp-row { display: flex; gap: 10px; align-items: stretch; }
.rg-otp-row input { flex: 1; min-width: 0; letter-spacing: .35em; text-align: center; font-weight: 600; }
.rg-otp-row .lp-btn { flex: none; }
.rg-otp-resend { margin: 8px 0 0; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--lp-accent, #c2410c); cursor: pointer; text-decoration: underline; }
.rg-otp-resend:disabled { color: var(--lp-muted); cursor: default; text-decoration: none; }
.rg-otp-msg { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--lp-muted); }
.rg-otp-msg.is-ok { color: #15803d; font-weight: 600; }
.rg-otp-msg.is-error { color: #c4262e; }
.rg-gate { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--lp-bg-alt, #f4f4f6); color: var(--lp-muted); font-size: 13.5px; text-align: center; }

/* The country's two-letter code, in the flag's place for every country but India. */
.rg-iso { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--lp-muted); }
.rg-iso[hidden] { display: none; }

/* The calling code opens the country list: a real <select> laid invisibly over it, so it works
   with a finger, a keyboard (type the country's name) and a screen reader. */
.rg-prefix { user-select: none; -webkit-user-select: none; cursor: pointer; }
.rg-prefix-caret { flex: none; color: var(--lp-muted); }
.rg-code-select {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 96px;
    margin: 0; padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}
.rg-phone:focus-within .rg-prefix { border-color: var(--lp-brand); }

/* ====================================================================
   The reference form's style: a centred card with an accent bar on top, a
   bold title, and plain full-width boxes two to a row.
   ==================================================================== */
.rg-page { --rg-radius: 2px; --rg-border: #c9c9ce; --rg-h: 40px; padding: 28px 16px 40px; }

.rg-card {
    max-width: 660px;
    padding: 24px 32px 18px;
    border-radius: 0;
    border-top: 5px solid var(--lp-brand);
}

.rg-head { margin-bottom: 20px; }
.rg-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }

/* Two boxes to a row, so the form is not a long ribbon; the logo, the code row and the terms take both. */
.rg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rg-field-address, .rg-field-business { grid-column: auto; }
.rg-field-wide, .rg-location, .rg-terms-cell, .rg-otp { grid-column: 1 / -1; }
.rg-field-pin { align-self: start; }
.rg-label-spacer { display: none; }

/* The password's show/hide button keeps its place at the right end. */
.rg-card .rg-password input { padding-right: 46px; }

/* Squarer buttons, to match the boxes. */
.rg-card .lp-btn { border-radius: 2px; }
.rg-otp .rg-otp-send, .rg-otp .rg-otp-send:hover { width: 100%; min-width: 0; }
.rg-otp-panel { max-width: none; }

.rg-submit { width: 100%; min-height: 46px; justify-self: stretch; border-radius: 2px; font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.rg-gate { border-radius: 2px; }

.rg-terms { min-height: 28px; font-size: 14px; }
.rg-terms-cell { align-self: stretch; }

.rg-foot { margin-top: 16px; }

@media (max-width: 560px) {
    .rg-page { padding: 14px 10px 32px; }
    .rg-card { padding: 22px 18px 16px; }
    .rg-head h1 { font-size: 23px; }
    /* One to a row on a phone. */
    .rg-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .rg-field-wide, .rg-location, .rg-terms-cell, .rg-otp { grid-column: auto; }
}

/* How to start: free trial, or pay now. Two compact choices side by side; stacked on a phone. */
.rg-start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.rg-start .rg-label-row { grid-column: 1 / -1; }
.rg-start-title { font-size: 13px; font-weight: 600; }
.rg-start-option { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rg-border, #d7dae0); border-radius: 10px; cursor: pointer; background: #fff; }
.rg-start-option:has(input:checked) { border-color: #d24a0a; box-shadow: 0 0 0 1px #d24a0a inset; background: #fff7f2; }
.rg-start-option.is-disabled { opacity: .6; cursor: not-allowed; }
.rg-start-option input { margin-top: 3px; accent-color: #d24a0a; }
.rg-start-body { display: grid; gap: 2px; min-width: 0; }
.rg-start-body strong { font-size: 13.5px; }
.rg-start-body small { font-size: 12px; color: #6b7280; line-height: 1.35; }
@media (max-width: 560px) { .rg-start { grid-template-columns: 1fr; } }

/* The radio sits small, at the left of its text (the form's general input rules made it a big circle on top). */
.rg-form .rg-start-option { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; padding: 11px 12px; }
.rg-form .rg-start-option input[type="radio"] {
    flex: none; width: 18px; height: 18px; min-height: 0; min-width: 0; margin: 2px 0 0; padding: 0;
    border-radius: 50%; appearance: auto; -webkit-appearance: radio; background: transparent; box-shadow: none;
}
.rg-form .rg-start-option input[type="radio"]:disabled { cursor: not-allowed; }
.rg-form .rg-start-body { flex: 1 1 auto; text-align: left; }
.rg-form .rg-start-body strong { display: block; line-height: 1.3; }
.rg-form .rg-start label.rg-start-option { display: flex !important; flex-direction: row !important; align-items: flex-start !important; gap: 10px !important; }
.rg-form .rg-start label.rg-start-option > input[type="radio"] { flex: 0 0 18px !important; width: 18px !important; height: 18px !important; margin: 2px 0 0 !important; }
.rg-form .rg-start label.rg-start-option > .rg-start-body { flex: 1 1 0 !important; min-width: 0; }
