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

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #f0f0f0;
    color: #333;
    min-height: 100vh;
}

.login-body {
    background: linear-gradient(135deg, #2d0a0a 0%, #1a0505 50%, #2d0a0a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid #c0392b;
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 30px 20px 20px;
}

.login-header .logo-placeholder {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-header h1 {
    color: #2d0a0a;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header .subtitle {
    color: #666;
    font-size: 14px;
}

.login-form {
    padding: 20px 30px 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

select.form-control {
    width: 280px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a93226, #c0392b);
    box-shadow: 0 6px 16px rgba(192, 57, 43, 0.4);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: #555;
    color: #fff;
}

.btn-secondary:hover {
    background: #444;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
}

.alert {
    margin: 0 30px 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.help-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.2s;
}

.help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.help-btn::after {
    content: "Si ingresa por primera vez, su usuario y clave es su número de cédula";
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    width: 260px;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
}

.help-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Portal header */
.portal-header {
    background: #1a0505;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid #c0392b;
}

.portal-header .header-inner {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-header .header-badge {
    background: #c0392b;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.portal-header .header-name {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 500;
}

.portal-header .header-actions {
    display: flex;
    gap: 6px;
}

.btn-sm {
    padding: 5px 14px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s;
}

.btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.25);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
    transform: none;
    box-shadow: none;
}

.btn-exit {
    background: #c0392b;
    color: #fff;
    border: 1px solid #c0392b;
}

.btn-exit:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: none;
    box-shadow: none;
}

/* Main content area */
.main-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.portal-content {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 25px;
}

.periodo-form {
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-group-inline label {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
}

.notas-section {
    margin-bottom: 0;
}

.notas-section h3 {
    color: #2d0a0a;
    margin-bottom: 15px;
    font-size: 18px;
}

.notas-table {
    width: 100%;
    border-collapse: collapse;
}

.notas-table {
    min-width: 900px;
}

.notas-table th {
    background: #2d0a0a;
    color: #fff;
    padding: 10px 10px;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}

.notas-table th:first-child {
    text-align: left;
}

.notas-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    text-align: center;
}

.notas-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.notas-table tbody tr:hover {
    background: #f9f9f9;
}

.nota-aprobado td:last-child {
    color: #2e7d32;
}

.nota-reprobado td:last-child {
    color: #c0392b;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #fde8e8;
    color: #c0392b;
}

.remedial-val {
    font-weight: 600;
    color: #e67e22;
}

.estadisticas {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #fff5f5, #fff);
    border: 1px solid #f0d0d0;
    border-radius: 10px;
}

.estadisticas h3 {
    color: #2d0a0a;
    margin-bottom: 15px;
    font-size: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 18px 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.stat-card .stat-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #2d0a0a;
}

.stat-card .stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-success {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.stat-success .stat-value {
    color: #2e7d32;
}

.stat-danger {
    background: #fde8e8;
    border-color: #f5c6cb;
}

.stat-danger .stat-value {
    color: #c0392b;
}

.change-password-container {
    max-width: 480px;
    margin: 60px auto;
}

.change-password-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 30px;
    border: 1px solid #e0e0e0;
}

.change-password-card h2 {
    text-align: center;
    margin-bottom: 25px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    color: #c0392b;
}
