@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --deped-blue:       #0038A8;
    --deped-blue-dark:  #002480;
    --deped-blue-light: #1A4FCC;
    --deped-gold:       #FCD116;
    --deped-gold-dark:  #E0B800;
    --deped-red:        #CE1126;
    --white:            #FFFFFF;
    --off-white:        #F5F7FC;
    --text-primary:     #0D1B3E;
    --text-muted:       #5B6B8A;
    --border:           rgba(0, 56, 168, 0.12);
    --shadow-card:      0 32px 80px rgba(0, 36, 128, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-btn:       0 8px 24px rgba(0, 56, 168, 0.35);
    --radius-card:      24px;
    --radius-btn:       14px;
    --transition:       0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--deped-blue-dark);
    overflow: hidden;
}

/* ── ANIMATED BACKGROUND ─────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(252, 209, 22, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(26, 79, 204, 0.3) 0%, transparent 60%),
        linear-gradient(145deg, #001560 0%, #0038A8 45%, #002480 100%);
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    animation: gridDrift 20s linear infinite;
}

@keyframes gridDrift {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* ── LAYOUT ───────────────────────────────────────────────────── */
.login-page-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

/* ── CARD ─────────────────────────────────────────────────────── */
.login-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 920px;
    min-height: 560px;
    background: var(--white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: cardReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}

/* ── IMAGE SLIDER ─────────────────────────────────────────────── */
.slider {
    position: relative;
    overflow: hidden;
    background: var(--deped-blue);
}

/* Decorative top stripe */
.slider::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--deped-blue) 0%, var(--deped-gold) 50%, var(--deped-red) 100%);
    z-index: 10;
}

.slider .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 24, 96, 0.35) 0%,
        rgba(0, 36, 128, 0.55) 60%,
        rgba(0, 24, 80, 0.80) 100%
    );
    z-index: 2;
}

.slides {
    display: flex;
    width: 300%;
    height: 100%;
    animation: none;
}

.slides img {
    width: calc(100% / 3);
    height: 100%;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

@keyframes slideShow {
    0%,  28% { transform: translateX(0); }
    33%,  61% { transform: translateX(calc(-100% / 3)); }
    66%, 94% { transform: translateX(calc(-200% / 3)); }
    100%      { transform: translateX(0); }
}

/* Slider caption */
.slider-caption {
    position: absolute;
    bottom: 32px;
    left: 32px;
    right: 32px;
    z-index: 3;
    color: var(--white);
}

.slider-caption .tagline {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.slider-caption .dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: var(--transition);
}

.dot.active {
    width: 20px;
    border-radius: 3px;
    background: var(--deped-gold);
}

/* Slider logo */
.slider-logo {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.slider-logo .logo-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── CONTENT PANEL ────────────────────────────────────────────── */
.content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 48px;
    background: var(--white);
    position: relative;
}

/* Top accent line */
.content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--deped-gold) 0%, var(--deped-blue) 100%);
}

/* Seal watermark */
.content::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0,56,168,0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.content-header {
    margin-bottom: 32px;
}

.dept-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--deped-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    padding: 5px 12px;
    background: rgba(0, 56, 168, 0.07);
    border-radius: 20px;
    border: 1px solid rgba(0, 56, 168, 0.15);
}

.dept-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--deped-gold);
    box-shadow: 0 0 0 2px var(--deped-blue);
}

.content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.content h1 span {
    color: var(--deped-blue);
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 400;
}

/* ── MESSAGES ─────────────────────────────────────────────────── */
.php-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 56, 168, 0.06);
    border: 1px solid rgba(0, 56, 168, 0.2);
    border-left: 3px solid var(--deped-blue);
    border-radius: 10px;
    font-size: 0.825rem;
    color: var(--deped-blue-dark);
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease both;
}

.php-message::before {
    content: '→';
    font-size: 0.85rem;
    opacity: 0.7;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── GOOGLE BUTTON ────────────────────────────────────────────── */
#loginForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 24px;
    background: var(--deped-blue);
    color: var(--white);
    border-radius: var(--radius-btn);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-btn);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-google::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.08) 100%);
    opacity: 0;
    transition: var(--transition);
}

.btn-google:hover {
    background: var(--deped-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 56, 168, 0.45);
}

.btn-google:hover::before { opacity: 1; }

.btn-google:active {
    transform: translateY(0);
    box-shadow: var(--shadow-btn);
}

.btn-google .google-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--white);
    border-radius: 8px;
    flex-shrink: 0;
}

.btn-google .google-icon-wrap img {
    display: block;
    width: 18px;
    height: 18px;
}

/* ── DIVIDER ──────────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── SECURITY NOTE ────────────────────────────────────────────── */
.security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--off-white);
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.775rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.security-note .shield-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--deped-blue) 0%, var(--deped-blue-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.security-note .shield-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.security-note strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

/* ── FOOTER ───────────────────────────────────────────────────── */
.content-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-left {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-left strong {
    display: block;
    color: var(--deped-blue);
    font-weight: 600;
    font-size: 0.75rem;
}

.ph-flag {
    display: flex;
    gap: 2px;
    border-radius: 3px;
    overflow: hidden;
    width: 30px;
    height: 20px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.ph-flag .blue  { flex: 1; background: var(--deped-blue); }
.ph-flag .red   { flex: 1; background: var(--deped-red); }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--deped-blue-dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: 1px solid rgba(252, 209, 22, 0.3);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 720px) {
    html, body { overflow: auto; }

    .login-page-wrapper { padding: 0; align-items: stretch; }

    .login-card {
        grid-template-columns: 1fr;
        grid-template-rows: 220px 1fr;
        border-radius: 0;
        min-height: 100dvh;
        box-shadow: none;
    }

    .slider { grid-row: 1; }
    .slider::before { height: 4px; }
    .slider-caption .tagline { font-size: 1.1rem; }
    .slider-logo { top: 20px; left: 20px; }
    .slider-logo img { width: 36px; height: 36px; }
    .slider-caption { bottom: 20px; left: 20px; right: 20px; }

    .content {
        padding: 36px 28px 40px;
        border-radius: 24px 24px 0 0;
        margin-top: -20px;
        position: relative;
        z-index: 2;
    }

    .content::before { border-radius: 24px 24px 0 0; }

    .content h1 { font-size: 1.65rem; }
}

@media (max-width: 400px) {
    .content { padding: 28px 20px 32px; }
    .content h1 { font-size: 1.45rem; }
    .btn-google { padding: 14px 18px; font-size: 0.85rem; }
}