/* Role-Based Academic Portals — Enterprise institutional design */

:root {
    --portals-text-dark: #111827;
    --portals-text-medium: #374151;
    --portals-text-muted: #6b7280;
    --portals-bg-section: #ffffff;
    --portals-bg-card: #ffffff;
    --portals-border: #E2E8F0;
    --portals-border-light: #f1f5f9;
    --portals-shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
    --portals-shadow-card-hover: 0 12px 32px rgba(15, 23, 42, 0.08);
    --portals-primary: #002FA7;
    --portals-secondary: #7c3aed;
    --portals-success: #059669;
    --portals-icon-gray: #64748b;
}

/* Main section */
.portals-section--static {
    background: var(--portals-bg-section);
    padding: 4rem 0;
    position: relative;
}

.portals-section--static .container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section header */
.portals-section--static .section-header {
    text-align: center;
    margin-bottom: 0;
}

.portals-section--static .section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--portals-text-dark);
}

.portals-section--static .section-header .title-main {
    display: block;
    color: var(--portals-text-dark);
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.portals-section--static .section-header.animate-in .title-main {
    opacity: 1;
    transform: translateY(0);
}

.portals-section--static .section-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--portals-text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 400;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.portals-section--static .section-header.animate-in .section-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Principal Control Layer (full width) ========== */
.portals-section--static .principal-layer {
    width: 100%;
    background: linear-gradient(180deg, #F1F4F9 0%, #E6EBF3 100%);
    padding: 4rem 0 5.5rem 0;
    margin-top: 3rem;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.portals-section--static .principal-layer.visible {
    opacity: 1;
    transform: translateY(0);
}

.portals-section--static .principal-layer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.portals-section--static .principal-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 4rem auto;
}

.portals-section--static .principal-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--portals-text-muted);
    margin-bottom: 1rem;
}

.portals-section--static .principal-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--portals-text-dark);
    margin-bottom: 1rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.portals-section--static .principal-subtitle {
    font-size: 1.0625rem;
    color: var(--portals-text-medium);
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

/* Principal features grid — max 4 cols desktop */
.portals-section--static .principal-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.portals-section--static .principal-feature {
    background: #ffffff;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    box-shadow: var(--portals-shadow-card);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portals-section--static .principal-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--portals-shadow-card-hover);
}

.portals-section--static .principal-feature-icon {
    color: #475569;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.portals-section--static .principal-feature-icon svg {
    display: block;
}

.portals-section--static .principal-feature-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--portals-text-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}

.portals-section--static .principal-feature-desc {
    font-size: 0.8125rem;
    color: var(--portals-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ========== Role Portals (below principal, 60px spacing) ========== */
.portals-section--static .portals-wrap {
    margin-top: 3.75rem;
}

.portals-section--static .portals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    position: relative;
}

/* Portal card — elevated, gradient top border */
.portals-section--static .portal-card {
    background: #ffffff;
    border: 1px solid var(--portals-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(20px);
}

.portals-section--static .portal-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, box-shadow 0.2s ease;
}

.portals-section--static .portal-card:nth-child(1).visible {
    transition-delay: 0.05s;
}

.portals-section--static .portal-card:nth-child(2).visible {
    transition-delay: 0.15s;
}

.portals-section--static .portal-card:nth-child(3).visible {
    transition-delay: 0.25s;
}

/* Soft gradient top border by role */
.portals-section--static .portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 3px;
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.portals-section--static .portal-card--student::before {
    background: linear-gradient(90deg, var(--portals-primary), #1e40af);
}

.portals-section--static .portal-card--teacher::before {
    background: linear-gradient(90deg, var(--portals-secondary), #6d28d9);
}

.portals-section--static .portal-card--parent::before {
    background: linear-gradient(90deg, var(--portals-success), #047857);
}

.portals-section--static .portal-card:hover {
    box-shadow: var(--portals-shadow-card-hover);
}

/* Card header */
.portals-section--static .portal-card-header {
    padding: 1.5rem 1.5rem 0.75rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.portals-section--static .portal-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.5rem;
}

.portals-section--static .portal-card--student .portal-label {
    color: var(--portals-primary);
}

.portals-section--static .portal-card--teacher .portal-label {
    color: var(--portals-secondary);
}

.portals-section--static .portal-card--parent .portal-label {
    color: var(--portals-success);
}

.portals-section--static .portal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--portals-text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.portals-section--static .portal-description {
    font-size: 0.875rem;
    color: var(--portals-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Capabilities list */
.portals-section--static .portal-capabilities {
    list-style: none;
    margin: 0;
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.portals-section--static .capability-item {
    font-size: 0.875rem;
    color: var(--portals-text-medium);
    line-height: 1.5;
    padding: 0.375rem 0 0.375rem 1.25rem;
    position: relative;
}

.portals-section--static .capability-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--portals-text-muted);
}

.portals-section--static .portal-card--student .capability-item::before {
    background: var(--portals-primary);
}

.portals-section--static .portal-card--teacher .capability-item::before {
    background: var(--portals-secondary);
}

.portals-section--static .portal-card--parent .capability-item::before {
    background: var(--portals-success);
}

/* Card footer */
.portals-section--static .portal-card-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--portals-border-light);
}

.portals-section--static .portal-button {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.portals-section--static .portal-card--student .portal-button {
    background: var(--portals-primary);
    color: #fff;
}

.portals-section--static .portal-card--student .portal-button:hover {
    background: #001d66;
    color: #fff;
}

.portals-section--static .portal-card--teacher .portal-button {
    background: var(--portals-secondary);
    color: #fff;
}

.portals-section--static .portal-card--teacher .portal-button:hover {
    background: #6d28d9;
    color: #fff;
}

.portals-section--static .portal-card--parent .portal-button {
    background: var(--portals-success);
    color: #fff;
}

.portals-section--static .portal-card--parent .portal-button:hover {
    background: #047857;
    color: #fff;
}

/* ========== Responsive ========== */

/* Tablet: principal 3 cols, portals 2 cols */
@media (max-width: 1024px) {
    .portals-section--static .principal-features {
        grid-template-columns: repeat(3, 1fr);
    }

    .portals-section--static .portals-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portals-section--static .portal-card:nth-child(3).visible {
        transition-delay: 0.2s;
    }
}

/* Mobile: principal 2 cols, portals 1 col */
@media (max-width: 768px) {
    .portals-section--static {
        padding: 3rem 0;
    }

    .portals-section--static .container {
        padding: 0 1.25rem;
    }

    .portals-section--static .principal-layer {
        padding: 3.5rem 0;
        margin-top: 2.5rem;
    }

    .portals-section--static .principal-layer-inner {
        padding: 0 1.25rem;
    }

    .portals-section--static .principal-header {
        margin-bottom: 2.5rem;
    }

    .portals-section--static .principal-title {
        font-size: 1.5rem;
    }

    .portals-section--static .principal-subtitle {
        font-size: 0.9375rem;
    }

    .portals-section--static .principal-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .portals-section--static .principal-feature {
        padding: 1.25rem 1rem;
    }

    .portals-section--static .principal-feature-icon {
        margin-bottom: 0.75rem;
    }

    .portals-section--static .principal-feature-icon svg {
        width: 28px;
        height: 28px;
    }

    .portals-section--static .portals-wrap {
        margin-top: 2.5rem;
    }

    .portals-section--static .portals-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .portals-section--static .portal-card-header {
        padding: 1.25rem 1.25rem 0.5rem 1.25rem;
    }

    .portals-section--static .portal-capabilities {
        padding: 1rem 1.25rem;
    }

    .portals-section--static .portal-card-footer {
        padding: 0.875rem 1.25rem 1.25rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .portals-section--static .principal-layer {
        padding: 2.5rem 0;
    }

    .portals-section--static .principal-features {
        gap: 0.75rem;
    }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {

    .portals-section--static .portal-card,
    .portals-section--static .principal-feature,
    .portals-section--static .principal-layer,
    .portals-section--static .title-main,
    .portals-section--static .section-subtitle {
        transition: none;
        animation: none;
        opacity: 1;
        transform: none;
    }

    .portals-section--static .principal-feature:hover {
        transform: none;
    }
}

.portals-section--static .portal-card:focus-within {
    outline: 2px solid var(--portals-primary);
    outline-offset: 4px;
}

.portals-section--static .portal-button:focus {
    outline: 2px solid var(--portals-primary);
    outline-offset: 2px;
}

@media (prefers-contrast: high) {

    .portals-section--static .portal-card,
    .portals-section--static .principal-feature {
        border-width: 2px;
        border-color: var(--portals-text-dark);
    }

    .portals-section--static .portal-button {
        border: 2px solid currentColor;
    }
}