/* ==========================================================================
   STUDIO TC — LOGIN PAGE DESIGN SYSTEM (MODERN DARK GLASSMORPHISM)
   ========================================================================== */

:root {
    --tc-primary: #FFD600;
    --tc-primary-hover: #ffea00;
    --tc-primary-active: #e6c200;
    --tc-primary-glow: rgba(255, 214, 0, 0.25);
    
    --tc-bg-dark: #09090b;
    --tc-card-bg: rgba(18, 18, 22, 0.78);
    --tc-card-border: rgba(255, 255, 255, 0.08);
    --tc-card-border-hover: rgba(255, 214, 0, 0.2);
    
    --tc-input-bg: rgba(12, 12, 15, 0.7);
    --tc-input-border: rgba(255, 255, 255, 0.12);
    --tc-input-focus: #FFD600;
    
    --tc-text-white: #ffffff;
    --tc-text-muted: #a1a1aa;
    --tc-text-subtle: #71717a;
    
    --tc-danger: #ef4444;
    --tc-danger-bg: rgba(239, 68, 68, 0.12);
    --tc-danger-border: rgba(239, 68, 68, 0.3);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-body);
    background-color: var(--tc-bg-dark);
    color: var(--tc-text-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- BACKGROUND STAGE --- */
.login-stage {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-image: url('../img/nova_hero_tc_4.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(255, 214, 0, 0.06), transparent 45%),
                linear-gradient(180deg, rgba(9, 9, 11, 0.72) 0%, rgba(9, 9, 11, 0.94) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1;
}

/* --- GLASS CARD CONTAINER --- */
.login-card-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    animation: entranceFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-card {
    background: var(--tc-card-bg);
    border: 1px solid var(--tc-card-border);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.75),
                0 0 40px rgba(255, 214, 0, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.login-card:hover {
    border-color: var(--tc-card-border-hover);
}

/* --- CARD HEADER --- */
.card-header-tc {
    text-align: center;
    margin-bottom: 32px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255, 214, 0, 0.1);
    border: 1px solid rgba(255, 214, 0, 0.25);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--tc-primary);
    margin-bottom: 18px;
}

.brand-badge i {
    font-size: 14px;
}

.logo-container-tc {
    margin-bottom: 14px;
}

.logo-tc {
    height: 64px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    transition: transform 0.4s ease;
}

.logo-tc:hover {
    transform: scale(1.04);
}

.login-main-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tc-text-white);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.login-sub-title {
    font-size: 0.88rem;
    color: var(--tc-text-muted);
    font-weight: 400;
}

/* --- ALERT ERROR BOX --- */
.login-alert-error {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--tc-danger-bg);
    border: 1px solid var(--tc-danger-border);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 0.86rem;
    margin-bottom: 22px;
    animation: alertSlide 0.3s ease forwards;
}

.login-alert-error.active {
    display: flex;
}

.login-alert-error i.alert-icon {
    font-size: 20px;
    color: var(--tc-danger);
    flex-shrink: 0;
}

.login-alert-error .alert-text {
    flex-grow: 1;
    line-height: 1.4;
}

.login-alert-error .alert-close {
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--tc-text-muted);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.login-alert-error .alert-close:hover {
    color: var(--tc-text-white);
}

/* --- FORM FIELDS --- */
.form-group-tc {
    margin-bottom: 20px;
}

.form-label-tc {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tc-text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.input-box-tc {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--tc-input-bg);
    border: 1px solid var(--tc-input-border);
    border-radius: 14px;
    transition: all 0.25s ease;
}

.input-box-tc:focus-within {
    border-color: var(--tc-input-focus);
    box-shadow: 0 0 0 3px var(--tc-primary-glow);
    background: rgba(18, 18, 22, 0.9);
}

.input-icon-left {
    position: absolute;
    left: 14px;
    color: var(--tc-text-subtle);
    font-size: 20px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-box-tc:focus-within .input-icon-left {
    color: var(--tc-primary);
}

.input-field-tc {
    width: 100%;
    height: 48px;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 16px 0 46px;
    font-family: var(--font-body);
    font-size: 0.94rem;
    color: var(--tc-text-white);
}

.input-field-tc::placeholder {
    color: var(--tc-text-subtle);
    opacity: 0.7;
}

/* Safari / Chrome autofill background fix */
.input-field-tc:-webkit-autofill,
.input-field-tc:-webkit-autofill:hover, 
.input-field-tc:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--tc-text-white) !important;
    -webkit-box-shadow: 0 0 0px 1000px #111116 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Password Toggle Button */
.btn-toggle-pass {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0 14px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tc-text-subtle);
    transition: color 0.2s;
}

.btn-toggle-pass:hover {
    color: var(--tc-text-white);
}

.btn-toggle-pass i {
    font-size: 20px;
}

/* --- ACTIONS ROW --- */
.form-actions-tc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -6px;
    margin-bottom: 24px;
    font-size: 0.84rem;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--tc-text-muted);
    user-select: none;
}

.remember-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--tc-input-border);
    border-radius: 4px;
    background: var(--tc-input-bg);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.remember-checkbox:checked {
    background-color: var(--tc-primary);
    border-color: var(--tc-primary);
}

.remember-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: var(--tc-text-muted);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.forgot-link:hover {
    color: var(--tc-primary);
    text-decoration: underline;
}

/* --- PRIMARY SUBMIT BUTTON --- */
.btn-submit-tc {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--tc-primary) 0%, #f59e0b 100%);
    border: none;
    border-radius: 14px;
    color: #09090b;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px var(--tc-primary-glow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-submit-tc:hover {
    background: linear-gradient(135deg, var(--tc-primary-hover) 0%, #fbbf24 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 214, 0, 0.4);
}

.btn-submit-tc:active {
    transform: translateY(0);
}

.btn-submit-tc:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit-tc i {
    font-size: 18px;
    transition: transform 0.2s;
}

.btn-submit-tc:hover i {
    transform: translateX(4px);
}

/* Spinner dentro do botão */
.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-submit-tc.is-loading .btn-text,
.btn-submit-tc.is-loading i {
    display: none;
}

.btn-submit-tc.is-loading .btn-spinner {
    display: inline-block;
}

/* --- CARD FOOTER --- */
.card-footer-tc {
    margin-top: 28px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--tc-text-subtle);
    font-size: 0.78rem;
}

.card-footer-tc i {
    font-size: 14px;
    color: var(--tc-text-muted);
}

/* --- MODAL AJUDA / ESQUECI A SENHA --- */
.tc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tc-modal-overlay.active {
    display: flex;
    animation: modalIn 0.3s ease;
}

.tc-modal-content {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

.tc-modal-icon {
    width: 54px;
    height: 54px;
    background: rgba(255, 214, 0, 0.12);
    border: 1px solid rgba(255, 214, 0, 0.3);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tc-primary);
    margin-bottom: 16px;
}

.tc-modal-icon i {
    font-size: 26px;
}

.tc-modal-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.tc-modal-desc {
    color: var(--tc-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.tc-modal-btn-close {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tc-modal-btn-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- ANIMAÇÕES --- */
@keyframes entranceFade {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.login-card.is-shaking {
    animation: shakeCard 0.45s ease-in-out;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 480px) {
    .login-stage {
        padding: 16px;
    }
    
    .login-card {
        padding: 30px 22px;
        border-radius: 20px;
    }
    
    .login-main-title {
        font-size: 1.5rem;
    }
    
    .form-actions-tc {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .forgot-link {
        align-self: flex-end;
    }
}