/* =============================================================================
   MAKE FUTURE MODEL SCHOOL — Student Portal
   Premium public-facing student login & report card download page
   ============================================================================= */

/* --- Portal Section ------------------------------------------------------- */
.student-portal {
    padding: var(--section-py) 0;
    background: var(--gray-50);
    min-height: 60vh;
}

/* --- Login Card ----------------------------------------------------------- */
.portal-login-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}

.portal-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-600), var(--gold-400), var(--blue-600));
}

.portal-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.portal-icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px rgba(30, 93, 232, 0.25);
}

.portal-card-header h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
}

.portal-card-header p {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* Login type toggle */
.login-type-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 1.75rem;
    position: relative;
}

.login-type-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.3s var(--ease);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.login-type-btn.active {
    background: var(--white);
    color: var(--blue-700);
    box-shadow: var(--shadow-sm);
}

.login-type-btn i {
    font-size: 0.8rem;
}

/* Form fields */
.portal-form .form-group {
    margin-bottom: 1.25rem;
}

.portal-form .form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.portal-form .form-label i {
    color: var(--blue-600);
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

.portal-form .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.portal-form .input-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.portal-form .form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: all 0.3s var(--ease);
}

.portal-form .form-input:focus {
    outline: none;
    border-color: var(--blue-400);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.portal-form .form-input::placeholder {
    color: var(--gray-400);
}

/* Submit button */
.portal-submit-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(30, 93, 232, 0.35);
    margin-top: 0.5rem;
}

.portal-submit-btn:hover {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-800));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 93, 232, 0.45);
}

.portal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.portal-submit-btn .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.portal-error {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(220, 38, 38, 0.15);
    margin-bottom: 1rem;
}

.portal-error.show {
    display: flex;
}

.portal-error i {
    flex-shrink: 0;
}

/* Rate limit warning */
.rate-limit-warning {
    display: none;
    text-align: center;
    padding: 1rem;
    background: #fef3c7;
    color: #d97706;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid rgba(217, 119, 6, 0.2);
    margin-bottom: 1rem;
}

.rate-limit-warning.show {
    display: block;
}

/* Security note */
.portal-security-note {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    color: var(--gray-400);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.portal-security-note i {
    color: var(--blue-400);
}

/* --- Student Profile Card (after login) ------------------------------------ */
.portal-result {
    max-width: 680px;
    margin: 0 auto;
    display: none;
}

.portal-result.show {
    display: block;
    animation: fadeSlideUp 0.5s var(--ease);
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.student-profile-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.profile-header {
    background: linear-gradient(135deg, var(--blue-700), var(--blue-800));
    padding: 1.75rem 2rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 85% 20%, rgba(247, 197, 39, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.profile-info {
    position: relative;
    z-index: 1;
}

.profile-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.15rem;
}

.profile-info .profile-meta {
    font-size: 0.82rem;
    color: var(--blue-200);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-info .profile-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Profile details grid */
.profile-details {
    padding: 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.profile-detail-item .label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
}

.profile-detail-item .value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* --- Report Status Card --------------------------------------------------- */
.report-status-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.report-status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
}

.report-status-icon.available {
    background: #d1fae5;
    color: #059669;
}

.report-status-icon.unavailable {
    background: #fef3c7;
    color: #d97706;
}

.report-status-icon.expired {
    background: #fee2e2;
    color: #dc2626;
}

.report-status-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.report-status-card p {
    font-size: 0.88rem;
    color: var(--gray-500);
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* Download button */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #059669, #047857);
    color: var(--white);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45);
    background: linear-gradient(135deg, #047857, #065f46);
}

.download-btn i {
    font-size: 1.1rem;
}

/* Availability window info */
.availability-info {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--gray-400);
    background: var(--gray-50);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
}

.availability-info i {
    color: var(--gray-400);
}

/* Back / Logout button */
.portal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-top: 1.5rem;
}

.portal-back-btn:hover {
    border-color: var(--blue-400);
    color: var(--blue-600);
    background: var(--blue-50);
}

/* --- Responsive ------------------------------------------------------------- */
@media (max-width: 768px) {
    .portal-login-card {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }

    .portal-result {
        margin: 0 1rem;
    }

    .profile-header {
        padding: 1.25rem 1.25rem;
        gap: 1rem;
    }

    .profile-details {
        padding: 1.25rem;
    }

    .report-status-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .portal-login-card {
        padding: 1.5rem 1.25rem;
    }

    .portal-icon-badge {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    .portal-card-header h2 {
        font-size: 1.35rem;
    }

    .login-type-btn {
        font-size: 0.78rem;
        padding: 0.5rem 0.75rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info .profile-meta {
        justify-content: center;
    }

    .profile-details {
        grid-template-columns: 1fr;
    }

    .download-btn {
        width: 100%;
        padding: 1rem 1.5rem;
    }

    .report-status-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
}

/* --- Academic History Timeline -------------------------------------------- */
.profile-history {
    padding: 1.25rem 2rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.history-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.history-title i {
    color: var(--blue-400);
}

.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 1.25rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--gray-200);
    border-radius: 2px;
}

.history-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    position: relative;
}

.history-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue-500);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--blue-200);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-left: -5px;
}

.history-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.history-class {
    font-weight: 700;
    color: var(--gray-800);
}

.history-year {
    color: var(--gray-500);
    font-size: 0.8rem;
}

.history-roll {
    font-size: 0.75rem;
    color: var(--blue-600);
    background: var(--blue-50);
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* --- Report Context Banner ----------------------------------------------- */
.report-context-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid var(--blue-200);
    border-radius: var(--radius-xl);
    margin-bottom: 1rem;
    animation: fadeSlideUp 0.4s var(--ease);
}

.report-context-banner > i {
    color: var(--blue-500);
    font-size: 1.2rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.report-context-banner div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.report-context-banner strong {
    font-size: 0.88rem;
    color: var(--blue-800);
}

.report-context-banner span {
    font-size: 0.8rem;
    color: var(--blue-600);
    line-height: 1.4;
}

/* --- Responsive adjustments for new elements ----------------------------- */
@media (max-width: 480px) {
    .profile-history {
        padding: 1rem 1.25rem 1.25rem;
    }

    .report-context-banner {
        padding: 0.85rem 1rem;
        font-size: 0.82rem;
    }
}

/* --- Fee Overview Card --------------------------------------------------- */
.fee-overview-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s var(--ease);
}

.fee-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.fee-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.fee-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.fee-current-month {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.fee-current-month.pending {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
}

.fee-current-month-info h3 {
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.fee-current-month-info p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.fee-current-month-status {
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

.fee-current-month-status.paid {
    background: #166534;
    color: white;
}

.fee-current-month-status.pending {
    background: #b45309;
    color: white;
}

.fee-history h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fee-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    flex-wrap: wrap;
    gap: 1rem;
}

.fee-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fee-item-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
}

.fee-item-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.fee-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fee-item-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.fee-item-status.paid {
    background: #d1fae5;
    color: #065f46;
}

.fee-item-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.fee-download-btn {
    background: transparent;
    border: 1px solid var(--blue-200);
    color: var(--blue-600);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.fee-download-btn:hover {
    background: var(--blue-50);
    border-color: var(--blue-300);
}

@media (max-width: 480px) {
    .fee-overview-card {
        padding: 1.5rem;
    }
    
    .fee-current-month {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fee-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fee-item-actions {
        width: 100%;
        justify-content: space-between;
    }
}
