/*
|--------------------------------------------------------------------------
| TanksConnected stylesheet owner: tc-auth.css
|--------------------------------------------------------------------------
| Owner for authentication pages:
| - login
| - register
| - forgot password
| - reset password
| - confirm password
| - verify email
|
| Theme-ready rule:
| Components use central --tc-* tokens so future themes only change tokens.
|--------------------------------------------------------------------------
*/

/* ==========================================================================
   1. Auth page shell
   ========================================================================== */

.tc-auth-shell {
    position: relative;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: clamp(1rem, 3vw, 2rem);
    background: var(--tc-page-gradient);
}

.tc-auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 10%, var(--tc-accent-soft), transparent 28rem),
        radial-gradient(circle at 80% 90%, rgba(var(--tc-accent-rgb), .10), transparent 32rem);
    opacity: .95;
}

.tc-auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: .42;
    color: rgba(226, 232, 240, .46);
}

.tc-bg-row {
    position: absolute;
    display: flex;
    gap: .75rem;
    white-space: nowrap;
    color: var(--tc-text-faint);
    font-size: .8rem;
    font-weight: var(--tc-weight-semibold);
    letter-spacing: .05em;
    text-transform: uppercase;
    animation: tc-auth-drift 44s linear infinite;
}

.tc-bg-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--tc-border-soft);
    border-radius: var(--tc-radius-pill);
    background: rgba(15, 23, 42, .42);
    padding: .35rem .75rem;
}

.tc-bg-row--one { top: 10%; left: -36%; animation-duration: 42s; }
.tc-bg-row--two { top: 22%; left: -58%; animation-duration: 48s; }
.tc-bg-row--three { top: 34%; left: -24%; animation-duration: 50s; }
.tc-bg-row--four { top: 48%; left: 40%; animation-duration: 46s; }
.tc-bg-row--five { top: 62%; left: 55%; animation-duration: 52s; }
.tc-bg-row--six { top: 76%; left: 70%; animation-duration: 58s; }

.tc-bg-keyword {
    position: absolute;
    color: rgba(var(--tc-accent-rgb), .12);
    font-size: clamp(1.2rem, 4.6vw, 3.6rem);
    font-weight: var(--tc-weight-hero);
    letter-spacing: .08em;
    text-transform: uppercase;
    filter: blur(.2px);
}

.tc-bg-keyword--one { top: 12%; left: 5%; }
.tc-bg-keyword--two { top: 38%; right: 8%; }
.tc-bg-keyword--three { bottom: 20%; left: 6%; }

@keyframes tc-auth-drift {
    from { transform: translateX(0); }
    to { transform: translateX(-34rem); }
}

/* ==========================================================================
   2. Auth cards and shared hero
   ========================================================================== */

.tc-auth-card,
.tc-auth-intro {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    border: 1px solid var(--tc-border-soft);
    border-radius: var(--tc-radius-xl);
    background:
        radial-gradient(circle at top left, var(--tc-accent-soft), transparent 24rem),
        linear-gradient(135deg, rgba(15, 23, 42, .88), rgba(2, 6, 23, .82));
    box-shadow: var(--tc-shadow-card);
    backdrop-filter: blur(18px);
}

.tc-auth-card {
    padding: clamp(1rem, 2.2vw, 1.55rem);
}

.tc-auth-hero {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: .45rem;
    margin-bottom: 1.15rem;
}

.tc-auth-hero-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.tc-auth-hero-logo img,
.tc-auth-intro-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tc-auth-hero-title,
.tc-auth-intro-title {
    margin: 0;
    color: var(--tc-heading);
    font-weight: var(--tc-weight-hero);
    letter-spacing: -.04em;
    line-height: .95;
}

.tc-auth-hero-title {
    font-size: clamp(1.55rem, 3.5vw, 2.1rem);
}

.tc-auth-hero-main {
    color: var(--tc-heading);
}

.tc-auth-hero-accent {
    color: var(--tc-accent);
}

.tc-auth-hero-subtitle,
.tc-auth-intro-subtitle {
    margin: 0;
    color: var(--tc-text-muted);
    line-height: 1.5;
}

.tc-auth-hero-subtitle {
    font-size: .94rem;
}

.tc-auth-secondary-link {
    color: var(--tc-accent);
    font-size: .88rem;
    font-weight: var(--tc-weight-semibold);
    text-decoration: none;
}

.tc-auth-secondary-link:hover,
.tc-auth-secondary-link:focus {
    color: var(--tc-heading);
    text-decoration: underline;
}

.tc-auth-secondary-link--spaced {
    margin-top: .35rem;
}

/* ==========================================================================
   3. Forms
   ========================================================================== */

.tc-auth-form {
    display: grid;
    gap: .95rem;
}

.tc-auth-field {
    display: grid;
    gap: .35rem;
}

.tc-auth-label {
    color: var(--tc-text-muted);
    font-size: .7rem;
    font-weight: var(--tc-weight-heavy);
    letter-spacing: .09em;
    text-transform: uppercase;
}

.tc-auth-card .tc-input,
.tc-auth-card input[type="email"],
.tc-auth-card input[type="text"],
.tc-auth-card input[type="password"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--tc-input-border);
    border-radius: var(--tc-radius-md);
    background: var(--tc-input-bg);
    color: var(--tc-input-text);
    outline: none;
    padding: .65rem .8rem;
}

.tc-auth-card .tc-input:focus,
.tc-auth-card input[type="email"]:focus,
.tc-auth-card input[type="text"]:focus,
.tc-auth-card input[type="password"]:focus {
    border-color: var(--tc-border-strong);
    box-shadow: 0 0 0 3px var(--tc-accent-soft);
}

.tc-auth-remember {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 46px;
    color: var(--tc-text-muted);
    font-size: .9rem;
    cursor: pointer;
    user-select: none;
}

.tc-auth-remember input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--tc-accent);
}

.tc-auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    margin-top: .35rem;
}

.tc-auth-submit,
.tc-auth-card .tc-btn-primary {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tc-button-border);
    border-radius: var(--tc-radius-pill);
    background: var(--tc-button-bg);
    color: var(--tc-button-text);
    font-weight: var(--tc-weight-heavy);
    text-decoration: none;
    padding: .55rem 1rem;
    cursor: pointer;
}


.tc-auth-secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-pill);
    background: var(--tc-surface-2);
    color: var(--tc-text-soft);
    font-weight: var(--tc-weight-bold);
    text-decoration: none;
    padding: .55rem 1rem;
    cursor: pointer;
}

.tc-auth-secondary-button:hover,
.tc-auth-secondary-button:focus {
    color: var(--tc-heading);
    border-color: var(--tc-border-strong);
    background: var(--tc-accent-soft);
}

.tc-auth-submit:hover,
.tc-auth-submit:focus,
.tc-auth-card .tc-btn-primary:hover,
.tc-auth-card .tc-btn-primary:focus {
    color: var(--tc-button-text);
    box-shadow: var(--tc-shadow-glow);
}

.tc-auth-footer {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: 1rem;
    color: var(--tc-text-muted);
    font-size: .88rem;
    text-align: center;
}

.tc-auth-footer a,
.tc-auth-legal-note a,
.tc-auth-intro-foot a {
    color: var(--tc-accent);
    font-weight: var(--tc-weight-semibold);
    text-decoration: none;
}

.tc-auth-footer a:hover,
.tc-auth-legal-note a:hover,
.tc-auth-intro-foot a:hover {
    color: var(--tc-heading);
    text-decoration: underline;
}

.tc-auth-legal-note {
    margin: .2rem 0 0;
    color: var(--tc-text-faint);
    font-size: .78rem;
    line-height: 1.55;
}

/* ==========================================================================
   4. Register split layout
   ========================================================================== */

.tc-auth-wrap {
    position: relative;
    z-index: 1;
    width: min(100%, 1060px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    align-items: center;
    gap: clamp(1rem, 3vw, 1.5rem);
}

.tc-auth-wrap .tc-auth-card {
    width: 100%;
}

.tc-auth-intro {
    width: 100%;
    display: grid;
    gap: 1.1rem;
    padding: clamp(1rem, 2.4vw, 1.7rem);
}

.tc-auth-intro-logo {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid var(--tc-border-soft);
    border-radius: var(--tc-radius-lg);
    background: rgba(15, 23, 42, .72);
    padding: .45rem;
    margin-bottom: .8rem;
}

.tc-auth-intro-title {
    max-width: 13ch;
    font-size: clamp(1.8rem, 4.4vw, 2.85rem);
}

.tc-auth-intro-subtitle {
    max-width: 44rem;
    margin-top: .65rem;
    font-size: 1rem;
}

.tc-auth-intro-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
}

.tc-auth-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--tc-border-soft);
    border-radius: var(--tc-radius-pill);
    background: var(--tc-accent-soft);
    color: var(--tc-heading);
    font-size: .78rem;
    font-weight: var(--tc-weight-heavy);
    padding: .35rem .7rem;
}

.tc-auth-badge-muted {
    background: rgba(15, 23, 42, .66);
    color: var(--tc-text-muted);
}

.tc-auth-feature-grid {
    display: grid;
    gap: .75rem;
}

.tc-auth-feature {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: .8rem;
    align-items: start;
    border: 1px solid var(--tc-border-soft);
    border-radius: var(--tc-radius-lg);
    background: rgba(15, 23, 42, .52);
    padding: .8rem;
}

.tc-auth-feature-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--tc-radius-md);
    background: var(--tc-accent-soft);
    color: var(--tc-accent);
}

.tc-auth-feature-icon svg {
    width: 34px;
    height: 34px;
}

.tc-icon-muted {
    opacity: .62;
}

.tc-icon-soft {
    opacity: .42;
}

.tc-auth-feature-title {
    color: var(--tc-heading);
    font-weight: var(--tc-weight-heavy);
}

.tc-auth-feature-text {
    margin-top: .1rem;
    color: var(--tc-text-muted);
    font-size: .86rem;
    line-height: 1.45;
}

.tc-auth-intro-foot {
    display: grid;
    gap: .55rem;
    color: var(--tc-text-muted);
    font-size: .86rem;
}

.tc-auth-intro-note {
    border-left: 3px solid var(--tc-accent);
    color: var(--tc-text-muted);
    padding-left: .75rem;
}

/* ==========================================================================
   5. Status, validation, compact auth pages
   ========================================================================== */

.tc-auth-card .mb-4,
.tc-auth-card .mt-4,
.tc-auth-card .mt-6 {
    margin: 0;
}

.tc-auth-card .text-red-600,
.tc-auth-card .text-red-500,
.tc-auth-card .text-red-400,
.tc-auth-card [class*="text-red"] {
    color: #fecaca;
}

.tc-auth-message {
    color: var(--tc-text-muted);
    line-height: 1.55;
}

.tc-auth-status {
    border: 1px solid rgba(34, 197, 94, .35);
    border-radius: var(--tc-radius-md);
    background: var(--tc-success-soft);
    color: #bbf7d0;
    padding: .75rem;
    font-size: .88rem;
}

/* ==========================================================================
   6. Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
    .tc-auth-shell {
        align-items: start;
        padding: .85rem;
        padding-bottom: calc(var(--tc-mobile-bar-height) + 1rem + env(safe-area-inset-bottom, 0px));
    }

    .tc-auth-wrap {
        grid-template-columns: 1fr;
    }

    .tc-auth-intro {
        display: none;
    }

    .tc-auth-card {
        width: min(100%, 460px);
    }
}

@media (max-width: 575.98px) {
    .tc-auth-shell {
        place-items: start center;
    }

    .tc-auth-card {
        border-radius: var(--tc-radius-lg);
        padding: .95rem;
    }

    .tc-auth-hero-logo {
        width: 48px;
        height: 48px;
    }

    .tc-auth-actions {
        display: grid;
        justify-items: stretch;
    }

    .tc-auth-submit,
    .tc-auth-card .tc-btn-primary {
        width: 100%;
    }

    .tc-auth-secondary-link {
        text-align: center;
    }

    .tc-bg-keyword {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tc-bg-row {
        animation: none;
    }
}

/* ==========================================================================
   3a. Friendly registration validation
   ========================================================================== */

.tc-auth-live-status {
    min-height: 1rem;
    color: var(--tc-text-faint);
    font-size: .75rem;
    font-weight: var(--tc-weight-semibold);
    line-height: 1.35;
}

.tc-auth-live-status.is-valid {
    color: #5eead4;
}

.tc-auth-live-status.is-invalid {
    color: #fca5a5;
}

.tc-auth-live-status.is-checking {
    color: #7dd3fc;
}

.tc-auth-password-help {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    color: var(--tc-text-faint);
    font-size: .74rem;
    font-weight: var(--tc-weight-semibold);
}

.tc-auth-password-help .is-valid {
    color: #5eead4;
}

.tc-auth-card .tc-input.is-valid {
    border-color: rgba(45, 212, 191, .62);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, .09);
}

.tc-auth-card .tc-input.is-invalid {
    border-color: rgba(248, 113, 113, .68);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, .08);
}

.tc-auth-submit:disabled {
    opacity: .48;
    cursor: not-allowed;
    box-shadow: none;
    filter: saturate(.55);
}

.tc-auth-submit:disabled:hover,
.tc-auth-submit:disabled:focus {
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   3b. Registration live-validation layout polish
   ========================================================================== */

.tc-auth-card--register {
    padding-block: 1rem;
}

.tc-auth-card--register .tc-auth-hero {
    gap: .3rem;
    margin-bottom: .75rem;
}

.tc-auth-card--register .tc-auth-hero-logo {
    width: 48px;
    height: 48px;
}

.tc-auth-card--register .tc-auth-form {
    gap: .62rem;
}

.tc-auth-card--register .tc-auth-field {
    gap: .22rem;
}

.tc-auth-card--register .tc-auth-live-status {
    min-height: 0;
    font-size: .7rem;
}

.tc-auth-card--register .tc-auth-live-status:empty {
    display: none;
}

.tc-auth-card--register .tc-auth-password-help {
    font-size: .7rem;
    line-height: 1.2;
}

.tc-auth-card--register .tc-auth-legal-note {
    margin-top: 0;
    font-size: .7rem;
    line-height: 1.42;
}

.tc-auth-card--register .tc-auth-actions {
    margin-top: .1rem;
}

.tc-auth-card--register .tc-auth-footer {
    margin-top: .7rem;
    font-size: .8rem;
}
