/**
 * Carley Connection — Auth pages
 * Sign In, Create Account, Forgot Password, Reset Password.
 *
 * Split layout: editorial column (image + copy) | form column.
 * Mobile collapses to single column with reduced editorial header.
 */

.cc-auth {
    min-height: calc(100vh - 80px);
    background: #fbfaf6;
}

.cc-auth__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 80px);
}

/* ---------- Editorial column ---------- */
.cc-auth__editorial {
    position: relative;
    overflow: hidden;
    background: #152a2d;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
}

.cc-auth__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.cc-auth__bg--placeholder {
    background:
        radial-gradient(at 30% 20%, #0a7575 0%, transparent 50%),
        radial-gradient(at 80% 80%, #203f43 0%, transparent 50%),
        #152a2d;
}

.cc-auth__editorial-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16, 31, 34, 0.25) 0%, rgba(16, 31, 34, 0.45) 50%, rgba(16, 31, 34, 0.85) 100%);
    z-index: 1;
}

.cc-auth__editorial-body {
    position: relative;
    z-index: 2;
    padding: 60px 56px;
    color: #fff;
    max-width: 540px;
}

.cc-auth__editorial-eyebrow {
    display: inline-block;
    font-family: var(--font-body, sans-serif);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #facb58;
    margin-bottom: 18px;
}

.cc-auth__editorial-headline {
    font-family: var(--font-heading, serif);
    font-size: clamp(28px, 3.5vw, 44px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 0 0 24px;
    color: #fff;
}

.cc-auth__editorial-headline em {
    font-style: italic;
}

.cc-auth__editorial-quote {
    border-left: 2px solid rgba(250, 203, 88, 0.6);
    padding: 6px 0 6px 18px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-family: var(--font-body, sans-serif);
}

.cc-auth__editorial-quote p {
    font-size: 14px;
    font-style: italic;
    line-height: 1.55;
    margin: 0 0 6px;
}

.cc-auth__editorial-quote cite {
    font-size: 11px;
    font-style: normal;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.cc-auth__editorial-sub {
    font-family: var(--font-body, sans-serif);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
    margin: 0 0 18px;
    max-width: 36ch;
}

.cc-auth__editorial-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cc-auth__editorial-list li {
    position: relative;
    padding-left: 22px;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.cc-auth__editorial-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 12px;
    height: 1px;
    background: #facb58;
}

/* ---------- Form column ---------- */
.cc-auth__form-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    background: #fbfaf6;
}

.cc-auth__form-inner {
    width: 100%;
    max-width: 420px;
}

.cc-auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 36px;
}

.cc-auth__brand-mark { display: inline-flex; }

.cc-auth__brand-name {
    font-family: var(--font-heading, serif);
    font-size: 18px;
    font-weight: 400;
    color: #203f43;
    letter-spacing: -0.3px;
}

.cc-auth__brand-name em {
    font-style: italic;
    color: #203f43;
}

.cc-auth__header {
    margin-bottom: 28px;
}

.cc-auth__eyebrow {
    display: inline-block;
    font-family: var(--font-body, sans-serif);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #946514;
    margin-bottom: 10px;
}

.cc-auth__title {
    font-family: var(--font-heading, serif);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 400;
    color: #203f43;
    margin: 0 0 12px;
    letter-spacing: -0.6px;
    line-height: 1.1;
}

.cc-auth__title em { font-style: italic; }

.cc-auth__sub {
    font-family: var(--font-body, sans-serif);
    font-size: 14px;
    color: #707978;
    line-height: 1.55;
    margin: 0;
}

/* ---------- OAuth providers ---------- */
.cc-auth__providers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.cc-auth__provider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 18px;
    background: #fff;
    border: 1px solid rgba(32, 63, 67, 0.2);
    border-radius: 6px;
    color: #203f43;
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.cc-auth__provider:hover {
    background: #fbfaf6;
    border-color: #203f43;
}

.cc-auth__provider:active { transform: scale(0.99); }

.cc-auth__provider--google svg { flex-shrink: 0; }

.cc-auth__divider {
    position: relative;
    text-align: center;
    margin: 4px 0 18px;
    color: rgba(32, 63, 67, 0.45);
    font-family: var(--font-body, sans-serif);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.cc-auth__divider::before,
.cc-auth__divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 70px);
    height: 1px;
    background: rgba(32, 63, 67, 0.12);
}
.cc-auth__divider::before { left: 0; }
.cc-auth__divider::after  { right: 0; }

.cc-auth__divider span {
    display: inline-block;
    padding: 0 12px;
}

/* ---------- Form ---------- */
.cc-auth__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cc-auth__row-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cc-auth__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cc-auth__label {
    font-family: var(--font-body, sans-serif);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #203f43;
}

.cc-auth__field input[type="text"],
.cc-auth__field input[type="email"],
.cc-auth__field input[type="password"],
.cc-auth__password-wrap input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(32, 63, 67, 0.18);
    border-radius: 6px;
    background: #fff;
    font-family: var(--font-body, sans-serif);
    font-size: 14px;
    color: #203f43;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.cc-auth__field input:focus,
.cc-auth__password-wrap input:focus {
    border-color: #203f43;
    box-shadow: 0 0 0 3px rgba(32, 63, 67, 0.08);
}

.cc-auth__field input::placeholder {
    color: rgba(32, 63, 67, 0.4);
}

.cc-auth__field input.has-error,
.cc-auth__password-wrap input.has-error {
    border-color: #ba1a1a;
    box-shadow: 0 0 0 3px rgba(186, 26, 26, 0.08);
}

/* Password show/hide */
.cc-auth__password-wrap {
    position: relative;
    display: block;
}

.cc-auth__password-wrap input {
    padding-right: 48px;
}

.cc-auth__password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    color: rgba(32, 63, 67, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.cc-auth__password-toggle:hover { color: #203f43; background: rgba(32, 63, 67, 0.06); }

/* Strength meter */
.cc-auth__strength {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cc-auth__strength-bar {
    display: block;
    height: 3px;
    width: 100%;
    background: rgba(32, 63, 67, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.cc-auth__strength-bar::after {
    content: '';
    position: absolute;
    inset: 0 100% 0 0;
    background: #ba1a1a;
    transition: inset 0.3s ease, background 0.3s ease;
    border-radius: 999px;
}

.cc-auth__strength[data-level="1"] .cc-auth__strength-bar::after { inset: 0 75% 0 0; background: #ba1a1a; }
.cc-auth__strength[data-level="2"] .cc-auth__strength-bar::after { inset: 0 50% 0 0; background: #d97706; }
.cc-auth__strength[data-level="3"] .cc-auth__strength-bar::after { inset: 0 25% 0 0; background: #946514; }
.cc-auth__strength[data-level="4"] .cc-auth__strength-bar::after { inset: 0 0    0 0; background: #1e7e3e; }

.cc-auth__strength-label {
    font-family: var(--font-body, sans-serif);
    font-size: 11px;
    color: #707978;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* Row: Remember + Forgot */
.cc-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Custom checkbox */
.cc-auth__check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    color: #4a5251;
    cursor: pointer;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

.cc-auth__check--block { display: flex; align-items: flex-start; gap: 10px; }
.cc-auth__check--block .cc-auth__check-box { margin-top: 2px; }

.cc-auth__check input { position: absolute; opacity: 0; pointer-events: none; }

.cc-auth__check-box {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(32, 63, 67, 0.35);
    border-radius: 4px;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cc-auth__check input:checked + .cc-auth__check-box {
    background: #203f43;
    border-color: #203f43;
}

.cc-auth__check input:checked + .cc-auth__check-box::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

.cc-auth__check input:focus-visible + .cc-auth__check-box {
    outline: 2px solid rgba(32, 63, 67, 0.4);
    outline-offset: 2px;
}

.cc-auth__check a {
    color: #203f43;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cc-auth__check--required.is-invalid .cc-auth__check-box {
    border-color: #ba1a1a;
}

/* Links */
.cc-auth__link {
    color: #203f43;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    transition: color 0.2s ease;
}

.cc-auth__link:hover { color: #946514; }

.cc-auth__link--small {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    border-bottom: none;
    text-decoration: none;
}

.cc-auth__link--small:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Message banner */
.cc-auth__msg {
    display: none;
    padding: 12px 14px;
    border-radius: 6px;
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    line-height: 1.45;
}

.cc-auth__msg--error {
    display: block;
    background: rgba(186, 26, 26, 0.08);
    border-left: 3px solid #ba1a1a;
    color: #8a1414;
}

.cc-auth__msg--success {
    display: block;
    background: rgba(39, 174, 96, 0.08);
    border-left: 3px solid #1e7e3e;
    color: #1e7e3e;
}

/* Submit button */
.cc-auth__submit {
    width: 100%;
    padding: 16px 22px;
    background: #203f43;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body, sans-serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    margin-top: 4px;
}

.cc-auth__submit:hover { background: #152a2d; }
.cc-auth__submit:active { transform: scale(0.99); }

.cc-auth__submit:disabled {
    background: rgba(32, 63, 67, 0.4);
    cursor: not-allowed;
    transform: none;
}

.cc-auth__submit .cc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cc-auth-spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Alt link below form */
.cc-auth__alt {
    text-align: center;
    margin: 8px 0 0;
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    color: #707978;
}

.cc-auth__alt .cc-auth__link {
    margin-left: 6px;
}

/* Footer trust line */
.cc-auth__footer {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid rgba(32, 63, 67, 0.08);
    text-align: center;
}

.cc-auth__trust {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body, sans-serif);
    font-size: 11px;
    letter-spacing: 0.4px;
    color: #707978;
}

.cc-auth__trust svg { color: rgba(32, 63, 67, 0.55); }

/* ---------- 2FA challenge modal ---------- */
.cc-2fa-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.cc-2fa-modal.is-visible { opacity: 1; pointer-events: auto; }

.cc-2fa-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 25, 25, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cc-2fa-modal__panel {
    position: relative;
    margin: 8vh auto 0;
    max-width: 440px;
    width: calc(100% - 32px);
    background: #fff;
    border-radius: 10px;
    padding: 36px 32px 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.cc-2fa-modal.is-visible .cc-2fa-modal__panel { transform: translateY(0); }

.cc-2fa-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #707978;
    cursor: pointer;
    padding: 4px 8px;
}
.cc-2fa-modal__close:hover { color: #203f43; }

.cc-2fa-modal__icon { color: #203f43; margin-bottom: 12px; }

.cc-2fa-modal__title {
    font-family: var(--font-heading, serif);
    font-size: 24px;
    font-weight: 400;
    color: #203f43;
    margin: 0 0 10px;
}

.cc-2fa-modal__text {
    font-family: var(--font-body, sans-serif);
    font-size: 13px;
    color: #4a5251;
    line-height: 1.55;
    margin: 0 0 18px;
}
.cc-2fa-modal__text code {
    background: rgba(32, 63, 67, 0.06);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.cc-2fa-modal__input {
    width: 100%;
    max-width: 280px;
    padding: 14px 16px;
    border: 1.5px solid rgba(32,63,67,0.2);
    border-radius: 6px;
    font-family: var(--font-body, sans-serif);
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 6px;
    color: #203f43;
    margin: 0 auto 8px;
    display: block;
}
.cc-2fa-modal__input:focus {
    outline: none;
    border-color: #203f43;
    box-shadow: 0 0 0 3px rgba(32,63,67,0.08);
}

.cc-2fa-modal__error {
    color: #ba1a1a;
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 14px;
}

.cc-2fa-modal__submit {
    width: 100%;
    padding: 14px 22px;
    background: #203f43;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body, sans-serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}
.cc-2fa-modal__submit:hover { background: #152a2d; }
.cc-2fa-modal__submit:disabled { opacity: 0.6; cursor: not-allowed; }

.cc-2fa-modal__alt {
    margin-top: 14px;
}

.cc-2fa-modal__toggle {
    background: transparent;
    border: none;
    color: #203f43;
    font-family: var(--font-body, sans-serif);
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 6px 10px;
}
.cc-2fa-modal__toggle:hover { color: #946514; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .cc-auth__editorial-body { padding: 48px 36px; }
    .cc-auth__form-col { padding: 48px 36px; }
}

@media (max-width: 768px) {
    .cc-auth__layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .cc-auth__editorial {
        min-height: 280px;
        max-height: 320px;
    }

    .cc-auth__editorial-body {
        padding: 28px 24px;
    }

    .cc-auth__editorial-headline {
        font-size: 24px;
    }

    .cc-auth__editorial-quote,
    .cc-auth__editorial-list {
        display: none; /* keep mobile lean — copy stays as headline */
    }

    .cc-auth__form-col {
        /* Bottom padding clears the fixed bottom tab nav (~74px) plus safe-area inset */
        padding: 32px 22px calc(110px + env(safe-area-inset-bottom, 0px));
        min-height: 0;
    }

    .cc-auth,
    .cc-auth__layout {
        min-height: 0;
    }

    /* Site header already shows the brand on mobile — hide the duplicate inside the form */
    .cc-auth__brand {
        display: none;
    }

    .cc-auth__brand {
        margin-bottom: 24px;
    }

    .cc-auth__title {
        font-size: 26px;
    }

    .cc-auth__sub {
        font-size: 13px;
    }

    .cc-auth__row-fields {
        grid-template-columns: 1fr;
    }

    .cc-auth__row {
        gap: 8px 12px;
    }
}

@media (max-width: 480px) {
    .cc-auth__editorial { display: none; } /* form-only on tiny screens */
    .cc-auth__form-col {
        padding: 28px 20px calc(110px + env(safe-area-inset-bottom, 0px));
        min-height: 0;
    }
    .cc-auth, .cc-auth__layout { min-height: 0; }
}
