/* ==========================================================================
   GemstoneSafe — Auth pages (login, register, password flows)
   Brand: gold #E0BB7F · cream #F7F4EE · white · black
   ========================================================================== */

:root {
    --gs-gold: #E0BB7F;
    --gs-gold-deep: #A8843F;   /* gold dark enough for text on light backgrounds */
    --gs-bronze: #6E5120;      /* deep gold for headline accents on the gold panel */
    --gs-gold-soft: rgba(224, 187, 127, .16);
    --gs-cream: #F7F4EE;
    --gs-white: #FFFFFF;
    --gs-black: #0E0E0E;
    --gs-ink: #1C1C1C;
    --gs-muted: #6B665E;
    --gs-line: #E7E1D6;
    --gs-danger: #B42318;
    --gs-danger-bg: #FEF3F2;
    --gs-success: #067647;
    --gs-success-bg: #ECFDF3;
    --gs-radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--gs-ink);
    background: var(--gs-cream);
    -webkit-font-smoothing: antialiased;
}

.gs-auth {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Brand panel (champagne gold) ---------- */
.gs-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: var(--gs-black);
    background: linear-gradient(155deg, #F5EAD6 0%, #EBD3A8 48%, #E0BB7F 100%);
}

.gs-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 380px at 12% 8%, rgba(255, 255, 255, .55), transparent 65%),
        radial-gradient(420px 420px at 100% 100%, rgba(168, 132, 63, .22), transparent 65%);
    pointer-events: none;
}

.gs-brand__top,
.gs-brand__body,
.gs-brand__foot { position: relative; z-index: 1; }

/* Long forms (register): brand panel stays fixed at screen height,
   only the form side scrolls */
.gs-auth--sticky { align-items: start; }
.gs-auth--sticky .gs-brand {
    position: sticky;
    top: 0;
    height: 100vh;
}
.gs-auth--sticky .gs-panel { min-height: 100vh; }

/* Decorative floating gems */
.gs-gem {
    position: absolute;
    z-index: 0;
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 18px 28px rgba(110, 81, 32, .28));
    animation: gs-gem-sway 10s ease-in-out infinite;
}

.gs-gem--lg {
    right: 7%;
    top: calc(50% - 120px);
    width: clamp(170px, 14vw, 270px);
}

.gs-gem--md {
    right: 12%;
    top: 9%;
    width: clamp(70px, 5.5vw, 104px);
    opacity: .85;
    animation-duration: 8s;
    animation-delay: -3s;
}

.gs-gem--sm {
    right: 26%;
    bottom: 9%;
    width: clamp(44px, 3.4vw, 64px);
    opacity: .7;
    animation-duration: 7s;
    animation-delay: -5s;
}

@keyframes gs-gem-sway {
    0%, 100% { transform: translateY(0) rotate(-9deg); }
    50%      { transform: translateY(-16px) rotate(7deg); }
}

@media (max-width: 1279.98px) {
    .gs-gem--lg { display: none; }
}

.gs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gs-bronze);
}

.gs-eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--gs-bronze);
}

.gs-brand__title {
    margin: 22px 0 18px;
    max-width: 470px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.01em;
    color: var(--gs-black);
}

.gs-brand__title span { color: var(--gs-bronze); }

.gs-brand__lead {
    max-width: 430px;
    margin: 0 0 32px;
    font-size: 15px;
    line-height: 1.65;
    color: #4A3F2E;
}

.gs-features {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 440px;
    border-top: 1px solid rgba(110, 81, 32, .25);
}

.gs-features li {
    display: flex;
    gap: 20px;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid rgba(110, 81, 32, .25);
}

.gs-features__num {
    flex: 0 0 auto;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--gs-bronze);
}

.gs-features strong {
    display: block;
    margin-bottom: 3px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gs-black);
}

.gs-features small {
    font-size: 13.5px;
    line-height: 1.5;
    color: #5A4E3B;
}

.gs-brand__foot {
    font-size: 12px;
    color: rgba(14, 14, 14, .5);
}

/* ---------- Form panel ---------- */
.gs-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.gs-card {
    width: 100%;
    max-width: 440px;
    padding: 40px 40px 32px;
    background: var(--gs-white);
    border: 1px solid var(--gs-line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(14, 14, 14, .04), 0 18px 40px -18px rgba(14, 14, 14, .18);
}

.gs-card--wide { max-width: 540px; }

.gs-logo {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto 30px;
}

.gs-card__head { margin-bottom: 26px; text-align: center; }

.gs-card__head h1 {
    margin: 0 0 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--gs-black);
}

.gs-card__head p {
    margin: 0;
    font-size: 14px;
    color: var(--gs-muted);
}

.gs-field { margin-bottom: 18px; }

/* Two fields side by side (e.g. first / last name) */
.gs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.gs-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 7px;
}

.gs-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gs-ink);
}

.gs-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--gs-gold-deep);
    text-decoration: none;
}

.gs-link:hover { color: var(--gs-black); text-decoration: underline; }

.gs-input-wrap { position: relative; }

.gs-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #A39D92;
    pointer-events: none;
    display: flex;
}

.gs-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font: inherit;
    color: var(--gs-ink);
    background: #FCFBF8;
    border: 1px solid var(--gs-line);
    border-radius: var(--gs-radius);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.gs-input::placeholder { color: #B1AA9E; }

.gs-input:hover { border-color: #D6CDBD; }

.gs-input:focus {
    outline: none;
    background: var(--gs-white);
    border-color: var(--gs-gold);
    box-shadow: 0 0 0 4px var(--gs-gold-soft);
}

.gs-input.has-toggle { padding-right: 48px; }

.gs-input.is-invalid { border-color: var(--gs-danger); background: var(--gs-white); }
.gs-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .12); }

/* Select styled like the inputs */
select.gs-input {
    padding-right: 42px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    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='%238A8478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

select.gs-input:invalid { color: #B1AA9E; }
select.gs-input option { color: var(--gs-ink); }

/* ---------- Custom dropdown (enhances a native <select data-gs-select>) ---------- */
/* The real <select> stays in the form (it is what gets submitted), just visually hidden */
.gs-select-native {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.gs-select__trigger {
    display: flex;
    align-items: center;
    padding-right: 42px;
    text-align: left;
    cursor: pointer;
}

.gs-select__trigger.is-placeholder { color: #B1AA9E; }

/* Chevron lives on its own layer so input focus/hover styles can't affect it */
.gs-select::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    pointer-events: none;
    background: 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='%238A8478' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
    transition: transform .2s ease;
}

.gs-select.is-open::after { transform: rotate(180deg); }

.gs-select.is-open .gs-select__trigger {
    background: var(--gs-white);
    border-color: var(--gs-gold);
    box-shadow: 0 0 0 4px var(--gs-gold-soft);
}

.gs-select__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 260px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    background: var(--gs-white);
    border: 1px solid var(--gs-line);
    border-radius: var(--gs-radius);
    box-shadow: 0 18px 40px -16px rgba(14, 14, 14, .25), 0 2px 6px rgba(14, 14, 14, .05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}

.gs-select.is-open .gs-select__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s;
}

.gs-select__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14.5px;
    color: var(--gs-ink);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}

.gs-select__option.is-active { background: var(--gs-cream); }

.gs-select__option.is-selected {
    font-weight: 600;
    color: var(--gs-black);
    background: var(--gs-gold-soft);
}

.gs-select__check { display: none; color: var(--gs-gold-deep); }
.gs-select__option.is-selected .gs-select__check { display: block; }

.gs-select__menu::-webkit-scrollbar { width: 8px; }
.gs-select__menu::-webkit-scrollbar-thumb { background: var(--gs-line); border-radius: 8px; }

.gs-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8A8478;
    cursor: pointer;
}

.gs-toggle:hover { color: var(--gs-black); background: var(--gs-cream); }
.gs-toggle:focus-visible { outline: 2px solid var(--gs-gold); outline-offset: 1px; }
.gs-toggle .icon-hide { display: none; }
.gs-toggle.is-visible .icon-show { display: none; }
.gs-toggle.is-visible .icon-hide { display: block; }

.gs-error {
    margin-top: 7px;
    font-size: 13px;
    color: var(--gs-danger);
}

.gs-hint {
    display: none;
    margin-top: 7px;
    font-size: 12px;
    color: var(--gs-gold-deep);
}

.gs-hint.is-on { display: block; }

.gs-captcha { margin: 4px 0 18px; }

.gs-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin-top: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--gs-white);
    background: var(--gs-black);
    border: 1px solid var(--gs-black);
    border-radius: var(--gs-radius);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .05s;
}

.gs-btn:hover { background: var(--gs-gold); border-color: var(--gs-gold); color: var(--gs-black); }
.gs-btn:active { transform: translateY(1px); }
.gs-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--gs-gold-soft); }

.gs-btn.is-loading { pointer-events: none; opacity: .85; }
.gs-btn.is-loading .gs-btn__label { visibility: hidden; }
.gs-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: var(--gs-gold);
    border-radius: 50%;
    animation: gs-spin .7s linear infinite;
}

@keyframes gs-spin { to { transform: rotate(360deg); } }

.gs-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    border-radius: 10px;
    border: 1px solid transparent;
}

.gs-alert--success { color: var(--gs-success); background: var(--gs-success-bg); border-color: #ABEFC6; }
.gs-alert--danger { color: var(--gs-danger); background: var(--gs-danger-bg); border-color: #FECDCA; }
.gs-alert svg { flex: 0 0 auto; margin-top: 1px; }
.gs-alert__text { flex: 1; }

.gs-alert__close {
    flex: 0 0 auto;
    padding: 0 2px;
    font-size: 18px;
    line-height: 1;
    color: inherit;
    background: none;
    border: 0;
    opacity: .6;
    cursor: pointer;
}

.gs-alert__close:hover { opacity: 1; }

.gs-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 18px;
    font-size: 12px;
    color: #A39D92;
}

.gs-divider::before,
.gs-divider::after { content: ""; flex: 1; height: 1px; background: var(--gs-line); }

.gs-btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--gs-black);
    text-decoration: none;
    background: var(--gs-white);
    border: 1.5px solid var(--gs-black);
    border-radius: var(--gs-radius);
    transition: background .2s, border-color .2s, color .2s;
}

.gs-btn-outline:hover { background: var(--gs-gold); border-color: var(--gs-gold); color: var(--gs-black); }
.gs-btn-outline:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--gs-gold-soft); }

.gs-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    font-size: 12px;
    color: #8A8478;
}

.gs-secure svg { color: var(--gs-gold-deep); }

/* ---------- Form card transitions (right side only) ---------- */
.gs-card {
    animation: gs-card-in .65s cubic-bezier(.22, 1, .36, 1) both;
}

/* Card content appears in a gentle stagger after the card lands */
.gs-card > * { animation: gs-content-in .55s cubic-bezier(.22, 1, .36, 1) both; }
/*
 * Each animated card child is its own stacking context, so an open dropdown's
 * z-index is trapped inside its block and later siblings (divider, "Sign in")
 * paint on top of it. Lift the block that holds the dropdown above its siblings.
 */
.gs-card > form,
.gs-card > :focus-within { position: relative; z-index: 5; }

.gs-card > :nth-child(1) { animation-delay: .12s; }
.gs-card > :nth-child(2) { animation-delay: .18s; }
.gs-card > :nth-child(3) { animation-delay: .24s; }
.gs-card > :nth-child(4) { animation-delay: .30s; }
.gs-card > :nth-child(5) { animation-delay: .36s; }
.gs-card > :nth-child(6) { animation-delay: .42s; }
.gs-card > :nth-child(n+7) { animation-delay: .48s; }

/* Leaving the page (e.g. "Become a seller" / "Sign in" links) */
.gs-card.is-leaving {
    animation: gs-card-out .28s cubic-bezier(.4, 0, 1, 1) forwards;
}

@keyframes gs-card-in {
    from { opacity: 0; transform: translateY(28px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

@keyframes gs-content-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@keyframes gs-card-out {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(-16px) scale(.985); }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .gs-auth { grid-template-columns: 1fr; }
    .gs-brand { display: none; }
    .gs-panel { min-height: 100vh; padding: 32px 16px; }
}

@media (max-width: 560px) {
    .gs-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .gs-card { padding: 30px 22px 24px; border-radius: 16px; }
    .gs-logo { max-width: 220px; margin-bottom: 24px; }
    /* reCAPTCHA is a fixed 304px widget — scale it down on very narrow phones */
    .gs-captcha .g-recaptcha { transform: scale(.9); transform-origin: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation-duration: 1.5s !important; }
    .gs-gem,
    .gs-card,
    .gs-card > *,
    .gs-card.is-leaving { animation: none !important; }
}

/* ---- Validation helpers (gs-auth-validate.js) & check-email / confirm screens ---- */
.gs-checklist { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--gs-muted, #6b6f76); }
.gs-checklist li { position: relative; padding-left: 18px; }
.gs-checklist li::before { content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #c9ccd2; }
.gs-checklist li.is-ok { color: var(--gs-success); }
.gs-checklist li.is-ok::before { background: var(--gs-success); border-color: var(--gs-success); }
.gs-captcha .gs-error { margin-top: 8px; }
.gs-note { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--gs-muted, #6b6f76); text-align: center; }
.gs-note strong { color: var(--gs-black); word-break: break-all; }
.gs-resend { margin-top: 18px; text-align: center; font-size: 14px; color: var(--gs-muted, #6b6f76); }
.gs-resend form { display: inline; }
.gs-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--gs-gold-deep); font-weight: 600; cursor: pointer; text-decoration: underline; }
.gs-linkbtn:disabled { color: #9aa0a8; cursor: not-allowed; text-decoration: none; }
.gs-actions { display: grid; gap: 10px; margin-top: 8px; }
.gs-alert form { margin-top: 10px; }
.gs-alert .gs-alert__text { flex: 1; }
.gs-btn--sm { padding: 9px 16px; font-size: 14px; }

/* ---- Dropdown: search box + opening upward ---- */
.gs-select__menu--search { padding-top: 0; }
.gs-select__search {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 -6px 4px;
    padding: 10px 10px 8px;
    background: var(--gs-white);
    border-bottom: 1px solid var(--gs-line);
}
.gs-select__search-input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    font: inherit;
    font-size: 14.5px;
    color: var(--gs-ink);
    background: #FCFBF8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238A8478' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
    border: 1px solid var(--gs-line);
    border-radius: var(--gs-radius);
    outline: 0;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.gs-select__search-input::placeholder { color: #B1AA9E; }
.gs-select__search-input:hover { border-color: #D6CDBD; }
.gs-select__search-input:focus { background-color: var(--gs-white); border-color: var(--gs-gold); box-shadow: 0 0 0 4px rgba(201, 162, 75, .16); }
.gs-select__empty { padding: 14px 12px; font-size: 14px; color: var(--gs-muted, #8A8478); text-align: center; }
.gs-select__empty[hidden], .gs-select__option[hidden] { display: none; }

/* Not enough room below the field: open above it */
.gs-select.is-up .gs-select__menu { top: auto; bottom: calc(100% + 8px); transform: translateY(6px); }
.gs-select.is-up.is-open .gs-select__menu { transform: none; }
