@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --blue: #223d97;
    --blue-dark: #172d75;
    --blue-light: #2d4fb5;
    --red: #c0392b;
    --red-light: #e74c3c;
    --gold: #c9a84c;
    --white: #ffffff;
    --off-white: #f5f6fa;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --shadow: 0 4px 24px rgba(34,61,151,0.13);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    min-height: 100vh;
    color: #1a1a2e;
}

/* ── Page background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(34,61,151,0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 80%, rgba(192,57,43,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Preloader ── */
#preloader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 20px;
}
#preloader img { width: 280px; max-width: 80vw; }
.preloader-bar {
    width: 200px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}
.preloader-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    background: var(--red);
    border-radius: 2px;
    animation: loadBar 2.5s ease forwards;
}
@keyframes loadBar { to { width: 100%; } }

/* ── Card ── */
.card {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: 32px auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeUp 0.6s ease both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Card header stripe ── */
.card-header { background: #ffffff; padding: 28px 32px 22px; text-align: center; position: relative; overflow: hidden; }

.card-header::before {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red) 0%, var(--gold) 50%, var(--red) 100%);
}
.card-header img { max-width: 280px; width: 90%; height: auto; display: block; margin: 0 auto; }

.card-header h1 { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: #223d97; letter-spacing: 0.02em; line-height: 1.3; }

.card-header p.subtitle { color: #666666; }

/* ── Card body ── */
.card-body { padding: 32px; }

/* ── Alert messages ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-error { background: #fef2f2; color: var(--red); border-left: 4px solid var(--red); }
.alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; }

/* ── Form ── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--blue);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    border: 1.5px solid var(--gray-light);
    border-radius: 8px;
    color: #1a1a2e;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-group input:focus,
.form-group select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(34,61,151,0.1);
}
.form-group .hint {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 4px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Button ── */
.btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    left: -60px; top: 0;
    width: 40px; height: 100%;
    background: rgba(255,255,255,0.18);
    transform: skewX(-20deg);
    transition: left 0.4s ease;
}
.btn:hover { background: var(--blue-light); box-shadow: 0 4px 16px rgba(34,61,151,0.3); transform: translateY(-1px); }
.btn:hover::after { left: 120%; }
.btn:active { transform: translateY(0); }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-light); box-shadow: 0 4px 16px rgba(192,57,43,0.3); }

/* ── Links ── */
.page-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-bottom: 4px;
}
.page-links a {
    font-size: 0.82rem;
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.2s;
}
.page-links a:hover { border-color: var(--blue); }

/* ── Success card ── */
.success-icon {
    width: 64px; height: 64px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    font-size: 2rem;
}
.success-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--blue);
    text-align: center;
    margin-bottom: 10px;
}
.success-text { color: var(--gray); text-align: center; font-size: 0.95rem; line-height: 1.6; }

/* ── Admin table ── */
.admin-wrap { max-width: 1100px; margin: 32px auto; padding: 0 16px; position: relative; z-index: 1; }
.admin-header {
    background: var(--blue);
    border-radius: 16px 16px 0 0;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header img { max-width: 200px; }
.admin-header h1 { font-family: 'Playfair Display', serif; color: white; font-size: 1.3rem; }
.admin-body { background: white; border-radius: 0 0 16px 16px; padding: 28px 32px; box-shadow: var(--shadow); }
.admin-body h2 { color: var(--blue); font-family: 'Playfair Display', serif; margin-bottom: 16px; font-size: 1.1rem; }
.search-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-row input {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid var(--gray-light); border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
}
.search-row input:focus { outline: none; border-color: var(--blue); }
.search-row button {
    padding: 10px 20px; background: var(--blue); color: white;
    border: none; border-radius: 8px; cursor: pointer; font-weight: 600;
    font-family: 'DM Sans', sans-serif;
}
.export-btn {
    display: inline-block; padding: 9px 16px;
    background: var(--red); color: white; border-radius: 8px;
    text-decoration: none; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 16px; transition: background 0.2s;
}
.export-btn:hover { background: var(--red-light); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th { background: var(--blue); color: white; padding: 10px 12px; text-align: left; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--gray-light); color: #333; }
tbody tr:hover { background: #f8f9ff; }
.badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.badge-male { background: #dbeafe; color: #1e40af; }
.badge-female { background: #fce7f3; color: #9d174d; }

@media (max-width: 600px) {
    .card { margin: 0; border-radius: 0; min-height: 100vh; }
    .card-header { padding: 22px 20px 18px; }
    .card-body { padding: 24px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .admin-wrap { padding: 0; }
    .admin-header { border-radius: 0; }
    .admin-body { border-radius: 0; padding: 20px 16px; }
    table { font-size: 0.78rem; }
    thead th, tbody td { padding: 8px 6px; }
}
