/**
 * Owner login / register entry screens — SelfGrow brand shell.
 * Scoped under .sg-auth-entry so Tabler auth pages stay untouched.
 */
.sg-auth-entry {
    /*
     * APCA (Lc on --sg-bg / white), verified with APCA-W3 0.0.98G:
     * ink 101 · muted 88 · muted-soft 77 · brand 94 · link-hover 78 · danger 81
     * control border 46–50 · placeholder 61 · CTA label on orange 60–64
     */
    --sg-ink: #0d1321;
    --sg-muted: #3f493a;
    --sg-muted-soft: #5a6555;
    --sg-placeholder: #858f7c;
    --sg-brand: #273b09;
    --sg-link-hover: #9a4400;
    --sg-danger: #b42318;
    --sg-brand-soft: #f3f6ec;
    --sg-accent: #d0e562;
    --sg-spark: #ff7f11;
    --sg-spark-deep: #e56f0a;
    /* --sg-line: decorative dividers only (Lc ~25); --sg-control: input boundaries (Lc ≥45) */
    --sg-line: #c5cdb6;
    --sg-control: #9aa788;
    --sg-control-strong: #5a6555;
    --sg-surface: #ffffff;
    --sg-bg: #f7f9f3;
    /* One control height + type size for OAuth, inputs and CTA so the column reads as one grid */
    --sg-control-h: 48px;
    --sg-control-fs: 1rem;
    --sg-radius: 14px;
    --sg-radius-sm: 10px;
    --sg-shadow: 0 1px 2px rgba(13, 19, 33, 0.04), 0 12px 32px rgba(39, 59, 9, 0.07);
    --sg-shadow-sm: 0 1px 2px rgba(13, 19, 33, 0.04), 0 6px 16px rgba(13, 19, 33, 0.06);
    --sg-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    min-height: 100vh;
    background: var(--sg-bg);
    color: var(--sg-ink);
    -webkit-font-smoothing: antialiased;
}

.sg-auth-entry .sg-auth-entry__form-col {
    position: relative;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(208, 229, 98, 0.18) 0%, transparent 55%),
        linear-gradient(180deg, #fcfdf9 0%, var(--sg-bg) 100%);
    border-top: 3px solid var(--sg-brand) !important;
}

.sg-auth-entry .sg-auth-entry__shell {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.sg-auth-entry .sg-auth-entry__brand {
    margin-bottom: 1.75rem;
}

.sg-auth-entry .sg-auth-entry__brand .login-logo {
    width: min(200px, 58vw);
    height: auto;
}

.sg-auth-entry .sg-auth-entry__title {
    font-size: clamp(1.55rem, 2.4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--sg-ink);
    margin-bottom: 0.45rem;
}

.sg-auth-entry .sg-auth-entry__lead {
    color: var(--sg-muted-soft);
    font-size: 0.98rem;
    line-height: 1.5;
    margin: 0 auto 1.35rem;
    max-width: 34ch;
}

.sg-auth-entry .sg-auth-entry__social {
    display: grid;
    gap: 0.75rem;
}

/* Flatten Bootstrap rows so OAuth buttons share the exact edges of the form fields */
.sg-auth-entry .sg-auth-entry__social > .row {
    margin: 0;
}

.sg-auth-entry .sg-auth-entry__social > .row > .col {
    padding: 0;
}

/* Neutralise legacy demo.css mobile inset (#loginForm { padding: 0 10px }) */
.sg-auth-entry #loginForm {
    padding-left: 0;
    padding-right: 0;
}

/* OAuth buttons — SaaS pattern: brand icon left, label centered, APCA-safe ink on white */
.sg-auth-entry .login-auth-btn,
.sg-auth-entry a.login-auth-btn,
.sg-auth-entry button.login-auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    min-height: var(--sg-control-h);
    padding: 0.625rem 1rem 0.625rem 3rem;
    border: 1px solid var(--sg-control);
    border-radius: var(--sg-radius-sm);
    background: var(--sg-surface);
    color: var(--sg-ink);
    font-weight: 600;
    font-size: var(--sg-control-fs);
    line-height: 1.25;
    letter-spacing: -0.01em;
    box-shadow: none;
    text-decoration: none;
    transition:
        border-color 0.18s var(--sg-ease),
        background 0.18s var(--sg-ease),
        box-shadow 0.18s var(--sg-ease);
}

.sg-auth-entry .login-auth-btn img {
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: 0 !important;
    transform: translateY(-50%);
    flex-shrink: 0;
}

.sg-auth-entry .login-auth-btn:hover,
.sg-auth-entry .login-auth-btn:focus-visible {
    border-color: var(--sg-control-strong);
    background: #fff;
    box-shadow: var(--sg-shadow-sm);
    color: var(--sg-ink);
    text-decoration: none;
}

.sg-auth-entry .login-auth-btn:focus-visible {
    outline: 2px solid var(--sg-brand);
    outline-offset: 2px;
}

.sg-auth-entry .hr-text {
    margin: 1.35rem 0 1.2rem;
    color: var(--sg-muted);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.sg-auth-entry .hr-text::before,
.sg-auth-entry .hr-text::after {
    border-color: var(--sg-line) !important;
}

.sg-auth-entry #loginForm .form-label,
.sg-auth-entry .form-label {
    font-weight: 600;
    color: var(--sg-ink);
    margin-bottom: 0.4rem;
}

.sg-auth-entry #loginForm .form-label-description a,
.sg-auth-entry .form-label-description a {
    color: var(--sg-brand);
    font-weight: 600;
    text-decoration: none;
}

.sg-auth-entry #loginForm .form-label-description a:hover,
.sg-auth-entry .form-label-description a:hover {
    color: var(--sg-link-hover);
    text-decoration: underline;
}

.sg-auth-entry #loginForm .form-control,
.sg-auth-entry .form-control {
    height: var(--sg-control-h);
    min-height: var(--sg-control-h);
    padding: 0 1rem;
    /* 16px stops iOS zoom-on-focus and keeps typed text at body-size APCA thresholds */
    font-size: var(--sg-control-fs);
    color: var(--sg-ink);
    border-radius: var(--sg-radius-sm);
    border-color: var(--sg-control);
    background: var(--sg-surface);
    box-shadow: none;
    transition: border-color 0.2s var(--sg-ease), box-shadow 0.2s var(--sg-ease);
}

.sg-auth-entry .form-control::placeholder {
    color: var(--sg-placeholder);
    opacity: 1;
}

.sg-auth-entry .form-control:hover,
.sg-auth-entry .input-group-flat:hover .form-control,
.sg-auth-entry .input-group-flat:hover .input-group-text {
    border-color: var(--sg-control-strong);
}

/* Solid brand edge carries the focus signal (Lc 98); the lime halo is decoration only */
.sg-auth-entry #loginForm .form-control:focus,
.sg-auth-entry .form-control:focus,
.sg-auth-entry .input-group-flat:focus-within .form-control,
.sg-auth-entry .input-group-flat:focus-within .input-group-text {
    border-color: var(--sg-brand);
    box-shadow: 0 0 0 3px rgba(208, 229, 98, 0.55);
}

.sg-auth-entry .input-group-flat:focus-within .form-control {
    box-shadow: none;
}

.sg-auth-entry .input-group-flat:focus-within {
    border-radius: var(--sg-radius-sm);
    box-shadow: 0 0 0 3px rgba(208, 229, 98, 0.55);
}

.sg-auth-entry .form-control.is-invalid,
.sg-auth-entry .input-group-flat .form-control.is-invalid {
    border-color: var(--sg-danger);
}

.sg-auth-entry .text-danger,
.sg-auth-entry .invalid-feedback {
    color: var(--sg-danger) !important;
    font-size: 0.875rem;
}

.sg-auth-entry .input-group-flat .input-group-text {
    height: var(--sg-control-h);
    background: var(--sg-surface);
    border-color: var(--sg-control);
    border-radius: 0 var(--sg-radius-sm) var(--sg-radius-sm) 0;
}

.sg-auth-entry .sg-auth-entry__pw-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -0.5rem -0.75rem -0.5rem 0;
    padding: 0;
    border: 0;
    border-radius: var(--sg-radius-sm);
    background: none;
    color: var(--sg-muted-soft);
    cursor: pointer;
}

.sg-auth-entry .sg-auth-entry__pw-toggle:hover {
    color: var(--sg-ink);
}

.sg-auth-entry .sg-auth-entry__pw-toggle:focus-visible {
    outline: 2px solid var(--sg-brand);
    outline-offset: -2px;
}

.sg-auth-entry .form-check-input {
    border-color: var(--sg-control);
}

.sg-auth-entry .form-check-input:checked {
    background-color: var(--sg-brand);
    border-color: var(--sg-brand);
}

.sg-auth-entry .form-check-input:focus-visible {
    outline: 2px solid var(--sg-brand);
    outline-offset: 2px;
}

.sg-auth-entry .input-group-flat .form-control,
.sg-auth-entry #loginForm .input-group-flat .form-control {
    border-right: 0;
    border-radius: var(--sg-radius-sm) 0 0 var(--sg-radius-sm);
}

.sg-auth-entry .input-group-flat .input-group-text {
    border-left: 0;
}

.sg-auth-entry .form-footer {
    margin-top: 1.25rem;
}

/*
 * Primary CTA: ink label on orange. Gradient stops kept light enough for Lc ≥60
 * (#ffa047 = 64, #ff9430 = 60). Darker stops such as #e56f0a drop to Lc 45, and
 * white-on-orange sits at Lc 54, so neither is used here.
 */
.sg-auth-entry .form-footer .btn-primary,
.sg-auth-entry .btn-primary {
    min-height: var(--sg-control-h);
    padding-top: 0;
    padding-bottom: 0;
    border: 0;
    border-radius: var(--sg-radius-sm);
    font-size: 1.0625rem;
    background: linear-gradient(180deg, #ffa047 0%, #ff9430 100%);
    color: var(--sg-ink) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.32) inset, 0 0 0 1px rgba(229, 111, 10, 0.35) inset, 0 10px 22px rgba(255, 127, 17, 0.26);
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: transform 0.18s var(--sg-ease), box-shadow 0.18s var(--sg-ease), filter 0.18s var(--sg-ease);
}

.sg-auth-entry .form-footer .btn-primary:hover,
.sg-auth-entry .btn-primary:hover {
    filter: brightness(1.04);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.36) inset, 0 0 0 1px rgba(229, 111, 10, 0.35) inset, 0 12px 26px rgba(255, 127, 17, 0.32);
    transform: translateY(-1px);
    color: var(--sg-ink) !important;
}

.sg-auth-entry .form-footer .btn-primary:focus-visible,
.sg-auth-entry .btn-primary:focus-visible {
    outline: 2px solid var(--sg-brand);
    outline-offset: 3px;
}

.sg-auth-entry .form-footer .btn-primary:active,
.sg-auth-entry .btn-primary:active {
    transform: translateY(0);
    filter: none;
    box-shadow: 0 1px 2px rgba(13, 19, 33, 0.12) inset;
}

.sg-auth-entry .sg-auth-entry__switch {
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--sg-muted);
    font-size: 0.95rem;
}

.sg-auth-entry .sg-auth-entry__switch a {
    color: var(--sg-brand);
    font-weight: 700;
    text-decoration: none;
}

.sg-auth-entry .sg-auth-entry__switch a:hover {
    color: var(--sg-link-hover);
    text-decoration: underline;
}

/*
 * Trust strip: quiet inline row, icon + label. Icons act as separators, so a
 * wrapped line never starts with an orphan middot.
 */
.sg-auth-entry .sg-auth-entry__trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin: 1.6rem 0 0;
    padding: 0;
    list-style: none;
    border: 0;
    background: none;
}

.sg-auth-entry .sg-auth-entry__trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    color: var(--sg-muted);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.sg-auth-entry .sg-auth-entry__trust-item svg {
    width: 15px;
    height: 15px;
    color: var(--sg-brand);
    flex-shrink: 0;
}

.sg-auth-entry .sg-auth-entry__hint {
    display: block;
    margin-top: 0.45rem;
    color: var(--sg-muted-soft);
    font-size: 0.875rem;
    line-height: 1.45;
}

.sg-auth-entry .form-check-label {
    color: var(--sg-muted);
    line-height: 1.45;
}

.sg-auth-entry .form-check-label a {
    color: var(--sg-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sg-auth-entry .form-check-label a:hover {
    color: var(--sg-link-hover);
}

.sg-auth-entry .alert {
    border-radius: var(--sg-radius-sm);
}

/*
 * In-app browser notice (Instagram / Facebook / LinkedIn WebViews).
 * Brand-soft surface: ink Lc 100, muted Lc 86, border Lc 46.
 */
.sg-auth-entry .sg-iab {
    margin: 0 0 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--sg-control);
    border-radius: var(--sg-radius-sm);
    background: var(--sg-brand-soft);
    color: var(--sg-ink);
    text-align: left;
}

.sg-auth-entry .sg-iab__head {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 0.625rem;
    align-items: start;
}

.sg-auth-entry .sg-iab__icon {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--sg-brand);
}

.sg-auth-entry .sg-iab__text,
.sg-auth-entry .sg-iab__hint,
.sg-auth-entry .sg-iab__copied {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.sg-auth-entry .sg-iab__fallback {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--sg-line);
}

.sg-auth-entry .sg-iab__hint {
    color: var(--sg-muted);
    font-weight: 500;
}

.sg-auth-entry .sg-iab__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--sg-control-h);
    padding: 0 1rem;
    border: 1px solid var(--sg-control);
    border-radius: var(--sg-radius-sm);
    background: var(--sg-surface);
    color: var(--sg-ink);
    font-size: var(--sg-control-fs);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s var(--sg-ease), box-shadow 0.18s var(--sg-ease);
}

.sg-auth-entry .sg-iab__copy svg,
.sg-auth-entry .sg-iab__copied svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sg-auth-entry .sg-iab__copy:hover {
    border-color: var(--sg-control-strong);
    box-shadow: var(--sg-shadow-sm);
}

.sg-auth-entry .sg-iab__copy:focus-visible {
    outline: 2px solid var(--sg-brand);
    outline-offset: 2px;
}

.sg-auth-entry .sg-iab__copied {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    color: var(--sg-brand);
    font-weight: 600;
}

.sg-auth-entry .sg-auth-entry__visual-col {
    position: relative;
    isolation: isolate;
    background: var(--sg-brand);
}

.sg-auth-entry .sg-auth-entry__visual {
    position: relative;
    min-height: 100vh;
    height: 100%;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: var(--sg-brand);
    background-image: var(--sg-auth-cover);
    background-size: cover;
    background-position: center;
}

.sg-auth-entry .sg-auth-entry__visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(13, 19, 33, 0.18) 0%, rgba(39, 59, 9, 0.62) 42%, rgba(13, 19, 33, 0.9) 100%),
        radial-gradient(80% 60% at 85% 10%, rgba(208, 229, 98, 0.28) 0%, transparent 60%);
    z-index: 1;
}

.sg-auth-entry .sg-auth-entry__visual-card {
    position: relative;
    z-index: 2;
    width: min(520px, 88%);
    margin: 0 0 clamp(2.5rem, 6vh, 4.5rem) clamp(1.75rem, 4vw, 3.5rem);
    padding: clamp(1.35rem, 2.4vw, 1.85rem);
    border-radius: var(--sg-radius);
    /* Dark glass keeps white copy at Lc ≥75 regardless of the cover photo */
    background: rgba(13, 19, 33, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    color: #fff;
}

.sg-auth-entry .sg-auth-entry__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: var(--sg-accent);
    color: var(--sg-brand);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sg-auth-entry .sg-auth-entry__visual-title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.sg-auth-entry .sg-auth-entry__visual-text {
    margin: 0 0 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.98rem;
    line-height: 1.55;
}

.sg-auth-entry .sg-auth-entry__points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.sg-auth-entry .sg-auth-entry__points li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 0.65rem;
    align-items: start;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    line-height: 1.4;
}

.sg-auth-entry .sg-auth-entry__points li svg {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--sg-accent);
}

@media (max-width: 991.98px) {
    .sg-auth-entry .sg-auth-entry__form-col {
        min-height: 100vh;
    }

    .sg-auth-entry .container-tight {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sg-auth-entry .login-auth-btn,
    .sg-auth-entry .btn-primary {
        transition: none;
    }

    .sg-auth-entry .login-auth-btn:hover,
    .sg-auth-entry .btn-primary:hover,
    .sg-auth-entry .btn-primary:active {
        transform: none;
    }
}
