@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root {
    --bg-main: #f4f6f8;
    --bg-card: #ffffff;
    --text-main: #202124;
    --text-muted: #5f6368;
    --border-color: #e0e0e0;
    --search-bg: #f1f3f4;
    --red: #8b0000;
    --red-hover: #a30000;
    --red-light: rgba(139,0,0,0.08);
}

body.dark-mode {
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e8eaed;
    --text-muted: #9aa0a6;
    --border-color: #333333;
    --search-bg: #2a2a2a;
    --red-light: rgba(139,0,0,0.15);
}

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

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("../static/img/mamerta.png");
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.7;
    z-index: -1;
}

body {
    background-image: url("../static/img/mamerta.png");
    background-size: cover;
    background-repeat: no-repeat;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* =========================================
   LOGIN & REGISTER UI (ACTBAYAN NEW DESIGN)
   ========================================= */

.auth-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background-color: var(--bg-main); /* This overlays the background specifically for login */
    position: relative;
    z-index: 10;
    transition: background-color 0.3s;
}

.left-panel {
    position: relative;
    background: linear-gradient(155deg, #6b0000 0%, #8b0000 40%, #b91c1c 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    overflow: hidden;
}

.left-panel::before {
    content: ''; position: absolute;
    width: 480px; height: 480px;
    border-radius: 50%; border: 80px solid rgba(255,255,255,0.05);
    top: -140px; left: -140px; pointer-events: none;
}
.left-panel::after {
    content: ''; position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%; border: 55px solid rgba(255,255,255,0.05);
    bottom: -90px; right: -90px; pointer-events: none;
}

.left-deco-dot {
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%; background: rgba(255,255,255,0.06);
    bottom: 160px; left: -50px; pointer-events: none;
}

.left-logo {
    font-size: 26px; font-weight: 900; color: white;
    letter-spacing: -0.5px; position: relative; z-index: 1; text-decoration: none;
    display: inline-flex !important; align-items: center !important; gap: 10px !important;
}
.left-logo span { color: rgba(255,255,255,0.5); }
.logobes {
    width: 40px !important; height: 40px !important; object-fit: contain !important;
    border-radius: 50% !important; flex-shrink: 0 !important; vertical-align: middle !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.left-logo:hover .logobes, .mobile-logo:hover .logobes, .sidebar-logo:hover .logobes, .logo:hover .logobes, .logo-container:hover .logobes {
    transform: scale(1.08) rotate(-3deg) !important;
}

.left-hero { position: relative; z-index: 1; }
.left-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50px; padding: 6px 14px; font-size: 12px;
    font-weight: 700; color: rgba(255,255,255,0.9);
    text-transform: uppercase; margin-bottom: 22px;
}
.left-headline {
    font-size: 40px; font-weight: 900; color: white;
    line-height: 1.12; letter-spacing: -1.5px; margin-bottom: 18px;
}
.left-headline em { font-style: normal; color: rgba(255,255,255,0.5); }
.left-sub { font-size: 15px; color: rgba(255,255,255,0.75); line-height: 1.65; max-width: 340px; margin-bottom: 36px; }

.left-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 26px; font-weight: 900; color: white; letter-spacing: -1px; }
.stat-label { font-size: 11px; color: rgba(255,255,255,0.6); font-weight: 600; text-transform: uppercase; }
.left-footer-text { font-size: 12px; color: rgba(255,255,255,0.4); position: relative; z-index: 1; }

.right-panel {
    background-color: var(--bg-card); display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 48px 60px;
    position: relative; transition: background-color 0.3s;
}

.theme-btn {
    position: absolute; top: 24px; right: 24px; width: 38px; height: 38px;
    border-radius: 50%; border: 1.5px solid var(--border-color); background: var(--search-bg);
    color: var(--text-muted); font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.theme-btn:hover { border-color: var(--red); color: var(--red); }
.back-link {
    position: absolute; top: 24px; left: 24px; font-size: 13px; font-weight: 700;
    color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 6px; transition: color 0.2s;
}
.back-link:hover { color: var(--red); }
.auth-box { width: 100%; max-width: 400px; animation: fadeUp 0.45s cubic-bezier(0.34,1.2,0.64,1) both; }

.tab-switcher {
    display: flex; background: var(--search-bg); border-radius: 12px;
    padding: 4px; margin-bottom: 32px; transition: background 0.3s;
}
.tab-btn {
    flex: 1; padding: 10px; border: none; border-radius: 9px; font-size: 14px;
    font-weight: 700; cursor: pointer; background: transparent; color: var(--text-muted); transition: all 0.25s;
}
.tab-btn.active { background: var(--red); color: white; box-shadow: 0 4px 14px rgba(139,0,0,0.3); }

.form-panel { display: none; }
.form-panel.active { display: block; animation: panelIn 0.3s ease both; }
.form-title { font-size: 26px; font-weight: 900; color: var(--text-main); letter-spacing: -0.8px; margin-bottom: 4px; }
.form-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.5; }
.form-subtitle a { color: var(--red); font-weight: 700; text-decoration: none; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-wrap i.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--text-muted); z-index: 5; transition: color 0.2s;
}
.input-wrap input, .input-wrap select {
    width: 100%; padding: 12px 46px 12px 40px; border: 1.5px solid var(--border-color); border-radius: 12px;
    font-size: 14.5px; background: var(--bg-main); color: var(--text-main);
    transition: all 0.25s cubic-bezier(0.16,1,0.3,1); outline: none;
}
.input-wrap input:focus, .input-wrap select:focus {
    border-color: var(--red); box-shadow: 0 0 0 3.5px var(--red-light);
}
.input-wrap input:focus ~ i.input-icon { color: var(--red); }

/* Prevent Edge/Windows/Chrome native password reveal eye button from overlapping custom eye icon */
.input-wrap input::-ms-reveal,
.input-wrap input::-ms-clear,
input::-ms-reveal,
input::-ms-clear,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

.input-wrap .toggle-pw {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 15px;
    color: #9ca3af; cursor: pointer; pointer-events: auto; transition: all 0.2s ease;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; z-index: 10;
}
.input-wrap .toggle-pw:hover {
    color: var(--red); background: rgba(220, 38, 38, 0.08); transform: translateY(-50%) scale(1.08);
}
.input-wrap .toggle-pw:active {
    transform: translateY(-50%) scale(0.95);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-strength { margin-top: 7px; display: flex; gap: 5px; align-items: center; }
.pw-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border-color); }
.pw-label { font-size: 11px; font-weight: 700; color: var(--text-muted); min-width: 44px; text-align: right; }

.options-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.remember-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.forgot-link { font-size: 13px; font-weight: 700; color: var(--red); text-decoration: none; }

.submit-btn {
    width: 100%; padding: 13px; background: var(--red); color: white; border: none; border-radius: 50px;
    font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(139,0,0,0.25); transition: background 0.2s, transform 0.2s;
}
.submit-btn:hover { background: var(--red-hover); transform: translateY(-2px); }

.divider {
    display: flex; align-items: center; gap: 12px; margin: 22px 0; font-size: 12px; font-weight: 700; color: var(--text-muted);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }

.social-row { display: flex; gap: 10px; }
.social-btn {
    flex: 1; padding: 10px; border: 1.5px solid var(--border-color); border-radius: 11px; background: var(--bg-main);
    color: var(--text-main); font-size: 13px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px; transition: all 0.2s;
}
.social-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

.terms-wrap {
    display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; font-size: 13px; color: var(--text-muted);
}
.terms-wrap a { color: var(--red); font-weight: 700; text-decoration: none; }

/* Modal & Toasts */
.toast-container { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 9998; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background-color: #1e1e1e; color: #fff; padding: 11px 22px; border-radius: 50px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 9px; opacity: 0; transform: translateY(18px); transition: all 0.35s; pointer-events: auto; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success i { color: #22c55e; }
.toast.info i { color: #60a5fa; }
.toast.error i { color: #f87171; }
body.dark-mode .toast { background-color: #e8eaed; color: #202124; }

.mini-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 800; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s; }
.mini-modal-backdrop.open { opacity: 1; visibility: visible; }
.mini-modal { background: var(--bg-card); border-radius: 18px; padding: 28px 30px; max-width: 360px; width: 100%; transform: scale(0.92); transition: transform 0.3s; }
.mini-modal-backdrop.open .mini-modal { transform: scale(1); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 860px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .left-panel { display: none; }
    .right-panel { padding: 48px 28px; min-height: 100vh; }
}
@media (max-width: 420px) { .form-row { grid-template-columns: 1fr; } .right-panel { padding: 48px 18px; } }

/* =========================================
   HOMEPAGE AND OTHER STYLES (PRESERVED)
   ========================================= */

span {
    color: red;
}

.topbar {
    position: fixed;
    display: block;
    background-color: antiquewhite;
    width: 100%;
    height: 60px;
    z-index: 1;
}

.topbar h1 {
    margin-top: 15px;
    margin-left: 50px;
}

#sb {
    display: grid;
    grid-template-areas: 'left-sidebar main-content';
    grid-template-columns: 100px 1fr;
}

#sb > .content{
    grid-area:main-content;
    margin-top: 100px;
}

#sb > .sidebar{
    grid-area:left-sidebar;
    background: yellow;
}

.sidebar {
    height: 780px;
    position: fixed;
}

#line1 {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#dateloc {
    position: absolute;
    left: 48px;
    top: 30px;
    display: flex;
    flex-direction: column;
}

#homepage {
    width: 100%;
    display: flex;
    gap: 50%;
    flex-direction: row;
}

#weather {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ann {
    position: absolute;
    display: flex;
    margin-top: 200px;
    margin-left: 50px;
    flex-direction: column;
}
/* FIX FOR BROKEN MAP TILES */
.leaflet-container img { max-width: none !important; max-height: none !important; }

