/* ==========================================================================
   ChronicSync Auth Variables
   Shared --cs-* tokens now live in chronosync-theme.css (loaded before this
   file) so the whole app uses one brand palette. Nothing below changes.
   ========================================================================== */

/* ==========================================================================
   Page
   ========================================================================== */
.cs-auth-page {
    min-height: 100vh;
    width: 100%;
    background: var(--cs-background);
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--cs-text);
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* body.login-page (AdminLTE) makes <body> a centering flex column and will
       shrink this page to the viewport height by default. On taller forms
       (e.g. Provider Register) that shrinks the white page below its own
       content, letting the body's background photo show through underneath
       it. Keep this at its natural content height instead. */
    flex-shrink: 0;
}

.cs-auth-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==========================================================================
   Brand Panel
   ========================================================================== */
.cs-auth-brand {
    position: relative;
    flex: 0 0 46%;
    max-width: 46%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
    background: linear-gradient(145deg, #071c36 0%, #073e75 45%, #087ce8 100%);
    pointer-events: none;
}

.cs-auth-brand-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.cs-auth-brand-decor::before,
.cs-auth-brand-decor::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.cs-auth-brand-decor::before {
    width: 560px;
    height: 560px;
    top: -180px;
    right: -200px;
}

.cs-auth-brand-decor::after {
    width: 420px;
    height: 420px;
    bottom: -160px;
    left: -140px;
    background: radial-gradient(circle at 70% 70%, rgba(8, 184, 212, 0.22), rgba(8, 184, 212, 0) 70%);
}

.cs-auth-brand-cross {
    position: absolute;
    bottom: 64px;
    right: 64px;
    width: 72px;
    height: 72px;
    opacity: 0.1;
    pointer-events: none;
}

.cs-auth-brand-cross::before,
.cs-auth-brand-cross::after {
    content: "";
    position: absolute;
    background: var(--cs-white);
    border-radius: 6px;
}

.cs-auth-brand-cross::before {
    top: 0;
    left: 28px;
    width: 16px;
    height: 72px;
}

.cs-auth-brand-cross::after {
    top: 28px;
    left: 0;
    width: 72px;
    height: 16px;
}

.cs-auth-brand-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
    color: var(--cs-white);
}

.cs-auth-brand-logo {
    width: auto;
    height: auto;
    max-width: 260px;
    max-height: 90px;
    object-fit: contain;
    margin-bottom: 32px;
}

.cs-auth-tagline {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px;
    color: var(--cs-white);
}

.cs-auth-brand-copy {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 28px;
}

.cs-auth-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cs-auth-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
}

.cs-auth-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: var(--cs-white);
    font-size: 11px;
}

/* ==========================================================================
   Auth Container / Form Side
   ========================================================================== */
.cs-auth-formside {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #f7fafd;
}

.cs-auth-mobile-brand {
    display: none;
}

/* ==========================================================================
   Auth Card
   ========================================================================== */
.cs-auth-card.login-box {
    width: 100%;
    max-width: 460px;
    margin: 0;
}

.cs-auth-cardbox.card {
    background: var(--cs-surface);
    border: 1px solid var(--cs-border);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(7, 28, 54, 0.08);
    margin: 0;
}

.cs-auth-cardheader.card-header {
    background: transparent;
    border: none;
    padding: 40px 40px 0;
}

.cs-auth-cardbody.card-body {
    padding: 24px 40px 40px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
.cs-auth-heading {
    font-size: 30px;
    font-weight: 700;
    color: var(--cs-text);
    margin: 0 0 8px;
}

.cs-auth-subtext {
    font-size: 15px;
    color: var(--cs-muted);
    margin: 0;
}

.cs-auth-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--cs-text);
    margin-bottom: 6px;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.cs-auth-form {
    margin-top: 28px;
}

.cs-auth-field {
    margin-bottom: 20px;
}

.cs-auth-input-group {
    position: relative;
}

.cs-auth-input-group.input-group {
    flex-wrap: nowrap;
}

.cs-auth-input.form-control {
    min-height: 48px;
    height: 48px;
    border: 1px solid var(--cs-border);
    border-radius: 12px !important;
    background: var(--cs-white);
    color: var(--cs-text);
    font-size: 15px;
    padding: 10px 16px;
    box-shadow: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.cs-auth-input.form-control:focus {
    border-color: var(--cs-blue);
    box-shadow: 0 0 0 3px rgba(8, 124, 232, 0.12);
    outline: none;
    border-color: var(--cs-blue);
    box-shadow: 0 0 0 3px rgba(8, 124, 232, 0.16);
}

.cs-auth-input-group .input-group-append {
    position: absolute;
    top: 0;
    right: 0;
    height: 48px;
    z-index: 5;
    pointer-events: none;
}

.cs-auth-input-group .input-group-text {
    height: 48px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--cs-muted);
    padding-right: 16px;
}

.cs-auth-input-group.input-group .form-control {
    border-radius: 12px;
    padding-right: 44px;
}

.cs-auth-password-group.input-group .form-control {
    padding-right: 76px;
}

.cs-auth-toggle {
    position: absolute;
    top: 0;
    right: 38px;
    height: 48px;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--cs-muted);
    z-index: 6;
    padding: 0 6px;
}

.cs-auth-toggle:hover {
    color: var(--cs-blue);
}

/* ==========================================================================
   Options Row (Remember me / Forgot password)
   ========================================================================== */
.cs-auth-row-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.cs-auth-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--cs-text);
    margin: 0;
    cursor: pointer;
}

.cs-auth-link,
.cs-auth-footer-link a {
    color: var(--cs-blue);
    font-weight: 600;
    text-decoration: none;
}

.cs-auth-link:hover,
.cs-auth-footer-link a:hover {
    color: var(--cs-teal);
    text-decoration: underline;
}

.cs-auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--cs-text);
    margin: 4px 0 24px;
}

.cs-auth-terms input[type="checkbox"] {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    accent-color: var(--cs-blue);
    cursor: pointer;
}

.cs-terms-row label {
    font-size: 0.85rem;
    color: var(--cs-muted);
    line-height: 1.5;
    cursor: pointer;
}

.cs-auth-terms a {
    color: var(--cs-blue);
    font-weight: 600;
    text-decoration: none;
}

.cs-auth-terms a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.cs-auth-submit.btn {
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: 11px;
    font-size: 16px;
    font-weight: 600;
    color: var(--cs-white);
    background: linear-gradient(135deg, var(--cs-blue), var(--cs-cyan));
    box-shadow: 0 10px 24px rgba(8, 124, 232, 0.22);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.cs-auth-submit.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(8, 124, 232, 0.28);
    color: var(--cs-white);
}

.cs-auth-submit.btn:focus {
    box-shadow: 0 0 0 3px rgba(8, 124, 232, 0.25);
}

.cs-auth-submit.btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   Notices
   ========================================================================== */
.cs-auth-notice {
    background: rgba(11, 182, 180, 0.08);
    border: 1px solid rgba(11, 182, 180, 0.25);
    color: var(--cs-text);
    border-radius: 10px;
    font-size: 14px;
    padding: 12px 16px;
    margin: 0 0 20px;
}

/* ==========================================================================
   Validation
   ========================================================================== */
.cs-auth-validation-summary {
    font-size: 13px;
    margin-bottom: 16px;
}

.cs-auth-validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

.cs-auth-field span.text-danger,
.cs-auth-field .field-validation-error {
    display: block;
    font-size: 13px;
    margin-top: 5px;
}

/* ==========================================================================
   Footer Links
   ========================================================================== */
.cs-auth-footer-link {
    text-align: center;
    font-size: 14px;
    color: var(--cs-muted);
    margin-top: 24px !important;
}

/* ==========================================================================
   Two-column grid (only used when multiple existing fields fit naturally)
   ========================================================================== */
.cs-auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .cs-auth-shell {
        flex-direction: column;
    }

    .cs-auth-brand {
        display: none;
    }

    .cs-auth-formside {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 40px 20px;
        background: var(--cs-background);
    }

    .cs-auth-mobile-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 20px;
    }

    .cs-auth-mobile-logo {
        width: auto;
        height: auto;
        max-width: 220px;
        max-height: 72px;
        object-fit: contain;
    }

    .cs-auth-cardheader.card-header {
        padding: 32px 24px 0;
    }

    .cs-auth-cardbody.card-body {
        padding: 20px 24px 32px;
    }

    .cs-auth-heading {
        font-size: 26px;
    }
}

@media (max-width: 576px) {
    .cs-auth-formside {
        padding: 24px 16px;
    }

    .cs-auth-cardheader.card-header {
        padding: 28px 20px 0;
    }

    .cs-auth-cardbody.card-body {
        padding: 18px 20px 28px;
    }

    .cs-auth-heading {
        font-size: 24px;
    }

    .cs-auth-mobile-logo {
        max-width: 180px;
        max-height: 60px;
    }

    .cs-auth-row-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cs-auth-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .cs-auth-submit.btn,
    .cs-auth-input.form-control,
    .cs-auth-toggle,
    .cs-auth-link,
    .cs-auth-footer-link a {
        transition: none !important;
    }

    .cs-auth-submit.btn:hover {
        transform: none;
    }
}
