/* =========================================================
   FEMS / SGEM – Stylesheet v1.1
   FGM Education Management System
   ========================================================= */

:root {
    --red:         #8B0000;
    --red-bright:  #C40000;
    --blue:        #4DA6FF;
    --blue-dark:   #1E90FF;
    --brown:       #8B5A2B;
    --brown-dark:  #6d431f;
    --black:       #111111;
    --white:       #ffffff;
    --light:       #f5f5f5;
    --gold:        #D4AF37;
    --muted:       #666666;
    --line:        #dddddd;
    --shadow:      0 10px 26px rgba(0,0,0,.10);
    --shadow-hover:0 22px 45px rgba(0,0,0,.22);
}

/* RESET */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--light);
    color: var(--black);
    line-height: 1.6;
    position: relative;
}

/* Subtle watermark */
body::before {
    content: "";
    position: fixed;
    top: 50%; left: 50%;
    width: 500px; height: 500px;
    transform: translate(-50%, -50%);
    background: url('../images/logos/fgm-logo.png') center / contain no-repeat;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

a { text-decoration: none; }
code {
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ── TOP BAR ──────────────────────────────────────────── */
.topbar {
    background: var(--black);
    color: var(--white);
    padding: 8px 6%;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── HEADER ───────────────────────────────────────────── */
header {
    background: var(--red);
    color: var(--white);
    padding: 14px 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fgm-logo {
    width: 64px; height: 64px;
    object-fit: contain;
    background: var(--white);
    border-radius: 50%;
    padding: 4px;
}

.fems-mini-logo {
    width: 58px; height: 58px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--white);
    padding: 3px;
}

.brand h1 { font-size: 24px; }
.brand p  { font-size: 13px; opacity: .95; }

nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

nav a {
    color: var(--white);
    font-weight: bold;
    font-size: 14px;
    transition: color .3s ease;
}
nav a:hover { color: var(--gold); }

/* ── HERO ─────────────────────────────────────────────── */
.hero {
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 70px 6%;
    background:
        linear-gradient(rgba(0,0,0,.60), rgba(0,0,0,.60)),
        linear-gradient(135deg, var(--red), var(--brown), var(--blue));
}

.hero-content { max-width: 980px; }

.hero-logo {
    width: 160px; max-width: 70%; height: auto;
    background: var(--white);
    border-radius: 20px;
    padding: 8px;
    margin-bottom: 16px;
}

.tag {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 50px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.32);
    margin-bottom: 18px;
}

.hero h2 { font-size: 46px; margin-bottom: 16px; }
.hero p   { font-size: 18px; max-width: 820px; margin: 0 auto 28px; }

/* ── BUTTONS ──────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    background: var(--red);
    color: var(--white);
    font-weight: 700;
    margin: 5px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, background .3s ease, color .3s ease;
}
.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,.25);
    background: #a50000;
    color: var(--white);
}

.btn.blue  { background: var(--blue);  color: var(--black); }
.btn.blue:hover { background: var(--blue-dark); color: var(--white); }

.btn.brown { background: var(--brown); color: var(--white); }
.btn.brown:hover { background: var(--brown-dark); }

.btn.dark  { background: var(--black); color: var(--white); }
.btn.dark:hover { background: #333; }

.btn.outline {
    background: transparent;
    border: 2px solid var(--white);
}
.btn.outline:hover { background: var(--white); color: var(--red); }

/* ── SECTIONS ─────────────────────────────────────────── */
.section { padding: 60px 6%; }

.section-title {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 35px;
}
.section-title h2 { color: var(--red); font-size: 32px; margin-bottom: 10px; }

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

/* ── CARDS ────────────────────────────────────────────── */
.card {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(2px);
    border-radius: 20px;
    padding: 30px;
    min-height: 180px;
    border-left: 6px solid var(--red);
    border-bottom: 6px solid var(--brown);
    box-shadow: var(--shadow);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    display: block;
}

.card::before {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.25), transparent);
    transition: .7s ease;
}
.card:hover::before { left: 120%; }

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-left-color: var(--blue);
    border-bottom-color: var(--red);
    background: linear-gradient(135deg, #ffffff, #f4f9ff);
}

.card h3 { color: var(--red); margin-bottom: 12px; transition: color .3s; }
.card:hover h3 { color: var(--blue-dark); }
.card p { color: #555; margin-bottom: 7px; line-height: 1.7; transition: color .3s; }
.card:hover p { color: #222; }

/* ── DASHBOARD ────────────────────────────────────────── */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    padding: 20px 6% 40px;
}
.dashboard .card { min-height: 200px; padding: 32px; }

/* ── INSTITUTION CARDS ────────────────────────────────── */
.institution-card { padding: 0; overflow: hidden; }

.institution-photo {
    height: 170px;
    background: linear-gradient(135deg, #e7e7e7, #cdeaff);
    position: relative;
}

.institution-logo {
    position: absolute;
    left: 18px; bottom: -36px;
    min-width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    font-weight: bold;
    font-size: 11px;
    padding: 5px;
    text-align: center;
}

.institution-body { padding: 50px 20px 22px; }

/* ── FORM CONTROLS ────────────────────────────────────── */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.controls input, .controls select,
.form-box input, .form-box select, .form-box textarea {
    padding: 13px;
    border: 1px solid #ccc;
    border-radius: 9px;
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: border-color .3s, box-shadow .3s;
}

.controls input:focus, .controls select:focus,
.form-box input:focus, .form-box select:focus, .form-box textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(77,166,255,.18);
}

.controls input, .controls select { max-width: 300px; }

.form-box {
    max-width: 960px;
    margin: 30px auto;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(2px);
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}

/* ── LOGIN ────────────────────────────────────────────── */
.login-box {
    max-width: 440px;
    margin: 70px auto;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(2px);
    padding: 34px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0,0,0,.13);
    text-align: center;
}
.login-box img  { max-width: 100px; margin-bottom: 10px; }
.login-box input,
.login-box button { width: 100%; padding: 13px; margin-bottom: 12px; }

/* ── ALERTS ───────────────────────────────────────────── */
.alert { padding: 13px; border-radius: 8px; margin-bottom: 12px; }
.alert.error   { background: #ffe1e1; color: var(--red); }
.alert.success { background: #e4ffe8; color: #0b6b1f; }

/* ── ADMIN LAYOUT ─────────────────────────────────────── */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 70vh;
}

.sidebar {
    background: var(--black);
    padding: 24px;
    color: var(--white);
}
.sidebar a {
    display: block;
    color: var(--white);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
    transition: color .3s, padding-left .3s;
}
.sidebar a:hover { color: var(--gold); padding-left: 8px; }

.content { padding: 30px 35px; }

/* ── TABLES ───────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(2px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table th, .table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
.table th { background: var(--red); color: var(--white); }
.table tr:hover td { background: #fafbff; }

/* ── FOOTER ───────────────────────────────────────────── */
footer {
    background: #050505;
    color: var(--white);
    text-align: center;
    padding: 45px 20px;
    border-top: 4px solid var(--red-bright);
    margin-top: 50px;
}

.footer-content { max-width: 1100px; margin: auto; }

.footer-title {
    color: var(--red-bright);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-title-fr {
    color: var(--blue);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-owner { margin: 14px 0; font-size: 15px; line-height: 1.8; }
.footer-red    { color: var(--red-bright); font-weight: 700; }
.footer-blue   { color: var(--blue);       font-weight: 700; }
.footer-gold   { color: var(--gold);       font-weight: 700; }

.footer-copy { margin-top: 20px; color: #cccccc; font-size: 13px; }

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 850px) {
    header { justify-content: center; text-align: center; }
    .brand { justify-content: center; flex-wrap: wrap; }
    nav    { justify-content: center; }
    .hero h2 { font-size: 32px; }
    .hero p  { font-size: 16px; }
    .topbar  { justify-content: center; text-align: center; }
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar { text-align: center; }
    .content { padding: 20px; }
}

@media (max-width: 520px) {
    .section { padding: 40px 5%; }
    .dashboard { padding: 20px 5%; grid-template-columns: 1fr; }
    .card { padding: 22px; }
    .hero { min-height: 480px; padding: 50px 5%; }
    .hero h2 { font-size: 28px; }
    .login-box { margin: 30px auto; padding: 24px; }
}
