:root {
    --auth-primary: var(--tms-cor-primaria, #1e3a8a);
    --auth-primary-dark: var(--tms-cor-botao, #1e40af);
    --auth-primary-light: var(--tms-cor-botao-hover, #3b82f6);
    --auth-text-dark: #1e293b;
    --auth-text-light: #64748b;
    --auth-border: #e2e8f0;
}

body {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 50%, var(--auth-primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 1rem;
    margin: 0;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(96, 165, 250, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
    z-index: 0;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    padding: 1rem;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 20px 56px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

.auth-header {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.auth-header-content { position: relative; z-index: 1; }

.auth-logo {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    padding: 12px;
}

.auth-logo:hover { transform: scale(1.05); }

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    image-rendering: smooth;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    max-width: 100%;
    max-height: 100%;
    min-width: 60px;
    min-height: 60px;
    display: block;
}

.auth-header h1,
.auth-header h2,
.auth-header p {
    display: none;
}

.auth-body {
    padding: 1.5rem 1.5rem 1.5rem;
    background: #ffffff;
}

.page-title {
    text-align: left;
    margin-bottom: 1rem;
}

.page-title h2 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--auth-text-dark);
    margin-bottom: 0.25rem;
    letter-spacing: -0.2px;
}

.page-title p {
    font-size: 0.6875rem;
    color: var(--auth-text-light);
    font-weight: 400;
    line-height: 1.4;
}

.form-group { margin-bottom: 1rem; }

.form-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.4375rem;
    font-weight: 600;
    color: var(--auth-text-dark);
    font-size: 0.6875rem;
    letter-spacing: 0.1px;
    text-transform: uppercase;
}

.form-label i {
    margin-right: 0.4375rem;
    color: var(--auth-primary);
    font-size: 0.75rem;
    width: 13px;
    text-align: center;
}

.form-control {
    width: 100% !important;
    padding: 0.6875rem 0.875rem !important;
    border: 1.5px solid var(--auth-border) !important;
    border-radius: 8px !important;
    font-size: 0.8125rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: #ffffff !important;
    color: var(--auth-text-dark) !important;
    box-sizing: border-box !important;
    font-weight: 400 !important;
}

.form-control:hover { border-color: #cbd5e1 !important; }

.form-control:focus {
    outline: none !important;
    border-color: var(--auth-primary-light) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.form-control::placeholder {
    color: #94a3b8 !important;
    font-weight: 400;
}

.btn-recuperar,
.btn-redefinir {
    width: 100% !important;
    padding: 0.75rem 1.125rem !important;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4375rem !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3) !important;
}

.btn-recuperar::before,
.btn-redefinir::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.btn-recuperar:hover,
.btn-redefinir:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4) !important;
    background: linear-gradient(135deg, var(--auth-primary-dark) 0%, var(--auth-primary-light) 100%) !important;
}

.btn-recuperar:hover::before,
.btn-redefinir:hover::before {
    left: 100%;
}

.btn-recuperar:active,
.btn-redefinir:active { transform: translateY(0) !important; }

.btn-recuperar:disabled,
.btn-redefinir:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.login-link {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--auth-border);
}

.login-link p {
    margin: 0;
    color: var(--auth-text-light);
    font-size: 0.6875rem;
}

.login-link a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-link a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.alert {
    border-radius: 6px !important;
    border: none !important;
    padding: 0.625rem 0.75rem !important;
    margin-bottom: 1rem !important;
    font-weight: 500;
    display: flex !important;
    align-items: center !important;
    gap: 0.4375rem !important;
}

.alert-success {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border-left: 3px solid #10b981 !important;
}

.alert-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-left: 3px solid #ef4444 !important;
}

.alert-info {
    background: #dbeafe !important;
    color: var(--auth-primary-dark, #1e40af) !important;
    border-left: 3px solid #3b82f6 !important;
}

.alert i { font-size: 0.8125rem; }

.info-box {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
}

.info-box h5,
.info-box h6 {
    color: var(--auth-text-dark);
    font-weight: 600;
    margin-bottom: 0.4375rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4375rem;
}

.info-box h5 i,
.info-box h6 i,
.info-box i {
    color: var(--auth-primary-light);
    font-size: 0.8125rem;
}

.info-box p {
    color: var(--auth-text-light);
    font-size: 0.6875rem;
    margin: 0;
    line-height: 1.4;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--auth-text-light);
    text-decoration: none;
    font-size: 0.6875rem;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--auth-primary);
    text-decoration: none;
}

.back-link i {
    margin-right: 0.375rem;
    font-size: 0.6875rem;
}

.user-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.user-info i {
    font-size: 1.25rem;
    color: var(--auth-primary-light);
    margin-bottom: 0.5rem;
}

.user-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--auth-text-dark);
    line-height: 1.4;
}

.user-info strong {
    color: var(--auth-primary-dark);
    font-weight: 600;
}

@media (max-width: 768px) {
    .auth-container { max-width: 100%; }
    .auth-card { border-radius: 16px; }
    .auth-header { padding: 1.5rem 1.25rem 1.25rem; }
    .auth-body { padding: 1.25rem 1.25rem 1.25rem; }
    .auth-logo {
        width: 72px;
        height: 72px;
        padding: 10px;
    }
    .auth-logo img {
        min-width: 50px;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    body { padding: 0.5rem; }
    .auth-header { padding: 1.25rem 1rem 1rem; }
    .auth-body { padding: 1rem 1rem 1rem; }
}
