/* Institutions area: builds on /area/area.css (background, login card, form fields). */

:root {
    --fw-display: 900;
    --fw-hero: 800;
    --fw-h2: 700;
    --fw-h3: 600;
    --fw-nav: 500;
    --fw-button: 600;
    --fw-body: 400;
    --fw-lead: 300;
}

.inst-page .card-content h1 { font-weight: var(--fw-hero); }
.inst-page .form-field label { font-weight: var(--fw-nav); }
.inst-page .btn-login { font-weight: var(--fw-button); }

.inst-kicker {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    font-weight: var(--fw-nav);
    letter-spacing: 0.04em;
    color: var(--pink);
    margin-bottom: 10px;
}

/* ---- Signed-in area ---- */
.inst-area {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.inst-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
}

.inst-header-logo img {
    height: 34px;
    display: block;
}

.inst-welcome {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px 96px;
    text-align: center;
}

.inst-title {
    font-family: var(--font);
    line-height: 1.15;
    margin-bottom: 16px;
}

.inst-title-hello {
    display: block;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: var(--fw-lead);
    color: var(--text-muted);
}

.inst-title-name {
    display: block;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: var(--fw-hero);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow-wrap: anywhere;
}

.inst-lead {
    font-size: 1.1rem;
    font-weight: var(--fw-lead);
    color: var(--text-muted);
    margin-bottom: 48px;
}

.inst-card {
    position: relative;
    padding: 44px 36px 40px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

.inst-card h2 {
    font-size: 1.35rem;
    font-weight: var(--fw-h2);
    margin-bottom: 12px;
}

.inst-card p {
    color: var(--text-muted);
    font-weight: var(--fw-body);
    line-height: 1.8;
}

/* Three small geometric marks that drift slowly, echoing the background */
.inst-card-shape {
    position: relative;
    width: 72px;
    height: 56px;
    margin: 0 auto 24px;
}

.inst-card-shape span {
    position: absolute;
    display: block;
    animation: instDrift 9s ease-in-out infinite;
}

.inst-card-shape span:nth-child(1) {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--orange), var(--pink));
    top: 10px;
    right: 6px;
}

.inst-card-shape span:nth-child(2) {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    top: 0;
    left: 8px;
    opacity: 0.85;
    animation-delay: -3s;
}

.inst-card-shape span:nth-child(3) {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid var(--purple);
    bottom: 0;
    left: 26px;
    opacity: 0.7;
    animation-delay: -6s;
}

@keyframes instDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(3px, -5px) rotate(8deg); }
}

.inst-contact {
    margin-top: 48px;
}

.inst-contact p {
    color: var(--text-muted);
    margin-bottom: 18px;
}

.inst-contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.inst-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    background: var(--gradient);
    color: #fff;
    font-weight: var(--fw-button);
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.inst-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(233, 69, 96, 0.35);
}

.inst-btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    color: var(--text);
}

.inst-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.inst-btn:focus-visible,
.btn-logout:focus-visible,
.back-home:focus-visible {
    outline: 2px solid var(--pink);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .inst-card-shape span { animation: none; }
    .inst-btn, .inst-btn:hover { transition: none; transform: none; }
}

@media (max-width: 600px) {
    .inst-header { padding: 18px 20px; }
    .inst-welcome { padding: 24px 20px 72px; }
    .inst-card { padding: 36px 22px 32px; border-radius: 20px; }
    .inst-contact-actions { flex-direction: column; align-items: stretch; }
    .inst-btn { justify-content: center; }
}
