/* ===== TeamClass Portal — Login Styles ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --tc-purple: #5B2D8E;
    --tc-purple-dark: #4A2475;
    --tc-purple-light: #7B4DB5;
    --tc-red: #E63946;
    --tc-white: #FFFFFF;
    --tc-gray-50: #F9FAFB;
    --tc-gray-100: #F3F4F6;
    --tc-gray-300: #D1D5DB;
    --tc-gray-400: #9CA3AF;
    --tc-gray-500: #6B7280;
    --tc-gray-700: #374151;
    --tc-green: #16A34A;
    --tc-amber: #F59E0B;
    --tc-radius: 12px;
    --tc-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0F0A1A;
    background-image: url('/static/media/fondo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== Overlay oscuro sobre fondo ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 26, 0.65);
    z-index: 0;
}

/* ===== Card de Login ===== */
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--tc-white);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow);
    padding: 48px 40px 40px;
    animation: fadeSlideUp 0.5s ease-out;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Logo ===== */
.login-logo {
    display: block;
    margin: 0 auto 32px;
    max-width: 220px;
    height: auto;
}

/* ===== Inputs ===== */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tc-gray-400);
    font-size: 18px;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    border: 2px solid var(--tc-gray-300);
    border-radius: var(--tc-radius);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--tc-gray-700);
    background: var(--tc-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--tc-purple);
    box-shadow: 0 0 0 3px rgba(91, 45, 142, 0.12);
}

.input-group input::placeholder {
    color: var(--tc-gray-400);
}

/* ===== Toggle Contraseña ===== */
.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--tc-gray-400);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--tc-purple);
}

/* ===== Link ===== */
.forgot-link {
    display: block;
    text-align: center;
    color: var(--tc-gray-500);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--tc-purple);
}

/* ===== Botón Principal ===== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--tc-purple);
    color: var(--tc-white);
    border: none;
    border-radius: var(--tc-radius);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: var(--tc-purple-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--tc-gray-300);
    cursor: not-allowed;
}

.btn-microsoft {
    width: 100%;
    padding: 14px;
    background: #2f2f32;
    color: var(--tc-white);
    border: none;
    border-radius: var(--tc-radius);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.3px;
}

.btn-microsoft:hover {
    background: #1f1f22;
}

.btn-microsoft:active {
    transform: scale(0.98);
}

.btn-microsoft:disabled {
    background: var(--tc-gray-300);
    cursor: not-allowed;
}

/* ===== Mensajes de error ===== */
.error-msg {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--tc-red);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.error-msg.visible {
    display: block;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== Barra de fortaleza ===== */
.strength-container {
    margin-bottom: 16px;
}

.strength-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--tc-gray-100);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* ===== Requisitos de contraseña ===== */
.password-requirements {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.password-requirements li {
    font-size: 12px;
    color: var(--tc-gray-500);
    padding: 3px 0;
    transition: color 0.2s;
}

.password-requirements li.valid {
    color: var(--tc-green);
}

.password-requirements li.invalid {
    color: var(--tc-red);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .login-card {
        margin: 16px;
        padding: 32px 24px 28px;
    }

    .login-logo {
        max-width: 180px;
    }
}

/* ===== Spinner carga ===== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--tc-white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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


/* ===== Mensajes de éxito ===== */
.success-msg {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: var(--tc-green);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.success-msg.visible {
    display: block;
}

/* ===== Texto informativo ===== */
.info-text {
    text-align: center;
    color: var(--tc-gray-500);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ===== Título secundario ===== */
h2 {
    text-align: center;
    color: var(--tc-purple);
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 700;
}

/* ===== Link de volver ===== */
.back-link {
    text-align: center;
    margin-top: 24px;
}

.back-link a {
    color: var(--tc-gray-500);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link a:hover {
    color: var(--tc-purple);
}
