/* ====== Base reset ====== */
* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
img { max-width: 100%; display: block; }

/* ====== Theme ====== */
:root{
    --bg1:#1aa37f;
    --bg2:#1a82c6;
    --card:#ffffff;
    --ink:#0f172a;
    --muted:#5b6475;
    --border:#e5e7eb;
    --brand:#0ea5a5;
    --ok:#10b981;       /* green */
    --danger:#ef4444;   /* red */
}

body.app, body.admin-auth, body.app.admin, body.auth{
    min-height:100vh;
    background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
    color: var(--ink);
    font: 500 16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif;
}

/* Styles for login page specifically */
body.auth-bg {
    display: grid;
    place-items: center;
}
.auth-wrap {
    width: min(800px, 90vw);
    margin: 2rem 0;
}
.auth-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    border-radius: 16px;
    overflow: hidden;
    background-color: var(--card);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.auth-left {
    background-color: #f8fafc;
    padding: 32px;
    display: grid;
    place-items: center;
    text-align: center;
}
.brand-wrap .brand-img {
    width: min(220px, 85%);
    height: auto;
    margin: 0 auto 16px;

}
.brand-wrap .brand-caption {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}
.auth-right {
    padding: 40px;
}
.auth-title {
    margin: 0 0 24px;
    font-size: 2rem;
    font-weight: 800;
}

/* ====== Forms ====== */
.field {
    position: relative;
    margin-bottom: 16px;
}
.field .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.5;
    background-repeat: no-repeat;
    background-position: center;
}
.icon.user { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>'); }
.icon.lock { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>'); }

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 1rem;
}
.toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 0;
    background-color: transparent;
    cursor: pointer;
    opacity: 0.6;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');
}
.toggle.on {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>');
}

/* ====== Buttons ====== */
.button{
    display:inline-flex; align-items:center; justify-content:center;
    padding:12px 16px; border-radius:8px;
    background:var(--brand); color:#fff; text-decoration:none; border:0;
    cursor:pointer; transition:filter .15s ease;
    font-weight:600; font-size: 1rem; width: 100%;
}
.button:hover{ filter:brightness(.95); }
.button.wide {
    width: 100%;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ====== Flash Message ====== */
.flash{
    background:#e0f2f1; color:#004d40; border:1px solid #80cbc4;
    padding:10px 12px; border-radius:8px; margin-bottom:12px;
}

/* ====== Responsive ====== */
@media (max-width: 768px){
    .auth-card {
        grid-template-columns: 1fr;
    }
    .auth-left {
        display: none; /* Hide image on mobile */
    }
    .auth-right {
        padding: 24px;
    }
}
