/* Estilos Principais - Portal do Aluno (Simulado Online)
   Paleta: Tons de Vermelho Nobre, Branco Puro e Cinza Claro
*/
:root {
    --primary: #dc2626;          /* Vermelho Nobre */
    --primary-hover: #b91c1c;    /* Vermelho Escuro */
    --primary-dark: #991b1b;     /* Vinho Suave */
    --primary-light: #fef2f2;    /* Fundo Vermelho Ultraclaro */
    --primary-border: #fecaca;   /* Borda Vermelha Suave */
    --primary-glow: rgba(220, 38, 38, 0.22);
    
    --accent: #e11d48;           /* Rosa Rubro */
    --success: #16a34a;          /* Verde Sucesso */
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    
    --text-main: #0f172a;        /* Grafite Escuro */
    --text-muted: #64748b;       /* Cinza Médio */
    --text-subtle: #94a3b8;      /* Cinza Claro Suave */
    
    --bg-main: #f8fafc;          /* Cinza Claro Fundo */
    --card-bg: rgba(255, 255, 255, 0.98);
    --card-border: #e2e8f0;      /* Cinza Contraste */
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus: #dc2626;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 30px -8px rgba(15, 23, 42, 0.08), 0 8px 12px -6px rgba(15, 23, 42, 0.03);
    --shadow-glow: 0 10px 25px -4px rgba(220, 38, 38, 0.32);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Fundo com formas decorativas em tons suaves de vermelho e cinza */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: float 22s infinite alternate ease-in-out;
}

.blob-1 {
    top: -12%;
    left: -10%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #fca5a5 0%, #ef4444 100%);
}

.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, #f87171 0%, #dc2626 100%);
    opacity: 0.25;
}

.blob-3 {
    top: 35%;
    left: 65%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, #cbd5e1 0%, #94a3b8 100%);
    opacity: 0.3;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(35px, 45px) scale(1.06); }
}

/* Layout Principal */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Cabeçalho */
.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0 2rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.system-clock-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-sm);
}

.system-clock-badge svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
    flex-shrink: 0;
}

.system-clock-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.system-clock-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.system-clock-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 52px;
    width: auto;
    flex-shrink: 0;
}

.brand-info h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.brand-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Área de Conteúdo Central */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 2rem;
}

.prazo-status-pill {
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pill-aberto {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.pill-aguardando {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid #fde68a;
}

.pill-encerrado {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* Card Principal de Autenticação */
.portal-card {
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.card-header p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Formulário e Campos */
.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-subtle);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-main);
    background-color: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 0.85rem;
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Dica / Auxílio */
.form-hint {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
}

.form-hint svg {
    width: 15px;
    height: 15px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Botão Primário */
.btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    transition: var(--transition-fast);
    margin-top: 1.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(220, 38, 38, 0.45);
}

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

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Alertas de Notificação */
.alert-box {
    display: none;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 1.25rem;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    display: flex;
    background-color: var(--danger-light);
    border: 1px solid var(--primary-border);
    color: #991b1b;
}

.alert-danger svg {
    width: 20px;
    height: 20px;
    color: var(--danger);
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-warning {
    display: flex;
    background-color: var(--warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-warning svg {
    width: 20px;
    height: 20px;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    display: flex;
    background-color: var(--success-light);
    border: 1px solid #bbf7d0;
    color: #166534;
}

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

/* Spinner de Carregamento */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================================
   TELA DE SUCESSO / ÁREA DO ALUNO APÓS LOGIN
   =================================================== */
.student-success-area {
    display: none;
    animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.student-welcome-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
}

.student-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px -3px rgba(220, 38, 38, 0.35);
}

.student-avatar svg {
    width: 38px;
    height: 38px;
}

.student-welcome-badge h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.exam-info-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.exam-info-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.exam-info-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.85rem;
    line-height: 1.4;
}

/* Card de Prazo do Aluno */
.student-prazo-box {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.86rem;
    font-weight: 600;
}

.student-prazo-box.prazo-liberado {
    background: var(--success-light);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.student-prazo-box.prazo-bloqueado {
    background: var(--warning-light);
    border: 1px solid #fde68a;
    color: #92400e;
}

.student-prazo-box.prazo-expirado {
    background: var(--danger-light);
    border: 1px solid var(--primary-border);
    color: #991b1b;
}

.student-prazo-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.exam-guidelines {
    list-style: none;
    margin-top: 1.25rem;
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exam-guidelines li {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exam-guidelines li svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Lista de opções quando o aluno está inscrito em mais de um simulado */
.simulado-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.simulado-option-card {
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.simulado-option-card:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.simulado-option-card:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.simulado-option-title {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.95rem;
}

.simulado-option-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.btn-start-exam {
    width: 100%;
    padding: 1.15rem 1.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px -4px rgba(220, 38, 38, 0.4);
    transition: var(--transition-fast);
}

.btn-start-exam:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -4px rgba(220, 38, 38, 0.5);
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.btn-start-exam.btn-disabled {
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.btn-start-exam svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.btn-start-exam:hover svg {
    transform: translateX(4px);
}

.btn-copy-exam-link {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: #ffffff;
    color: var(--text-main);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-copy-exam-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-copy-exam-link.copied {
    border-color: #16a34a;
    color: #16a34a;
    background: #f0fdf4;
}

.btn-copy-exam-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-logout {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 1rem;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    color: var(--primary);
}

/* Rodapé */
.portal-footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid #e2e8f0;
}

/* Responsividade */
@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }

    .portal-card {
        padding: 1.6rem 1.25rem;
    }

    .card-header h2 {
        font-size: 1.35rem;
    }

    .brand-info h1 {
        font-size: 1.15rem;
    }

    .brand-logo {
        height: 42px;
    }
}
