/* css/style.css — Login pages (modern split-screen, blue & yellow brand) */

:root {
    --dark-blue: #004AAD;
    --dark-blue-700: #003f93;
    --dark-blue-900: #002a63;
    --primary-blue: #4A90E2;
    --primary-yellow: #F7BA16;
    --primary-yellow-dark: #d99f0d;
    --border-color: #e3e9f2;
    --text-secondary: #64748b;
    --radius-sm: 10px;
    --radius-lg: 26px;
    --shadow-lg: 0 25px 60px rgba(0, 42, 99, 0.18);
}

* { box-sizing: border-box; }

/* Scoped to .login-page only — this stylesheet is also loaded on every
   dashboard page (via header.php) alongside main.css, so bare `body`
   layout rules here would leak into and break the dashboard layout. */
body.login-page {
    font-family: 'Sarabun', sans-serif;
    background: #ffffff;
    color: #333;
    margin: 0;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* === Login shell (split-screen) === */
.login-shell {
    display: flex;
    width: 100%;
    max-width: 920px;
    min-height: 580px;
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: rise 0.5s ease;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Left: branding panel --- */
.login-visual {
    flex: 1 1 42%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 40px;
    color: #fff;
    background: linear-gradient(160deg, var(--dark-blue) 0%, var(--dark-blue-700) 55%, var(--dark-blue-900) 100%);
    border-right: 4px solid var(--primary-yellow);
    overflow: hidden;
}
.login-visual::before,
.login-visual::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247, 186, 22, 0.4) 0%, rgba(247, 186, 22, 0) 70%);
    pointer-events: none;
}
.login-visual::before { width: 320px; height: 320px; top: -120px; right: -110px; }
.login-visual::after { width: 260px; height: 260px; bottom: -100px; left: -90px; background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%); }

.login-logo {
    position: relative;
    z-index: 2;
    width: 150px;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
}
.login-site-name {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
}
.login-site-subtitle {
    position: relative;
    z-index: 2;
    font-size: 1em;
    font-weight: 500;
    color: #dbe9fb;
    line-height: 1.5;
    max-width: 300px;
    margin: 0;
}
.login-tagline {
    position: relative;
    z-index: 2;
    font-size: 0.88em;
    color: rgba(219, 233, 251, 0.85);
    line-height: 1.7;
    max-width: 300px;
    margin: 10px 0 0;
}

/* --- Right: form panel --- */
.login-form-panel {
    flex: 1 1 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
}
.login-form-inner { width: 100%; max-width: 360px; }

.login-heading {
    color: var(--dark-blue);
    font-size: 1.55em;
    font-weight: 700;
    margin: 0 0 6px;
    text-align: left;
}
.login-subheading {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin: 0 0 26px;
    text-align: left;
}

h1, h2 {
    color: var(--dark-blue);
    text-align: center;
    margin-bottom: 25px;
}

.form-group { margin-bottom: 18px; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-blue);
    font-size: 0.95em;
}

.input-wrapper { position: relative; }
.input-wrapper i.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.95em;
    pointer-events: none;
}
.input-wrapper input[type="text"],
.input-wrapper input[type="password"] { padding-left: 40px; }
.input-wrapper .toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    font-size: 0.95em;
    transition: color 0.2s ease;
}
.input-wrapper .toggle-password:hover { color: var(--primary-blue); }
.input-wrapper input[type="password"].has-toggle,
.input-wrapper input[type="text"].has-toggle { padding-right: 40px; }

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    font-size: 16px;
    font-family: 'Sarabun', sans-serif;
    background-color: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
    outline: none;
    background-color: #fff;
}

.btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--dark-blue);
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 74, 173, 0.3); }
.btn:active { transform: translateY(0); }

.btn-primary { background-color: var(--dark-blue); }
.btn-primary:hover { background-color: var(--dark-blue-700); }

.btn-warning { background-color: var(--primary-yellow); color: #333; }
.btn-warning:hover { background-color: var(--primary-yellow-dark); }

.alert {
    padding: 13px 15px;
    margin: 0 0 18px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
}
.alert-danger { background-color: #fdecea; color: #b3261e; border: 1px solid #f6cdc9; }
.alert-success { background-color: #e3f6e8; color: #1e7b34; border: 1px solid #c3e6cb; }

.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}
.captcha-wrapper img {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.captcha-wrapper input { flex: 1; min-width: 0; }
.captcha-refresh {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--primary-blue);
    font-size: 1em;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.captcha-refresh:hover { background-color: #eaf2fd; transform: rotate(90deg); }

.login-footer-note {
    text-align: center;
    margin-top: 22px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* === Responsive === */
@media screen and (max-width: 860px) {
    .login-shell { flex-direction: column; max-width: 440px; min-height: auto; }
    .login-visual { padding: 34px 30px 30px; border-right: none; border-bottom: 4px solid var(--primary-yellow); }
    .login-logo { width: 96px; margin-bottom: 14px; }
    .login-site-name { font-size: 1.2em; margin-bottom: 6px; }
    .login-site-subtitle { font-size: 0.9em; }
    .login-tagline { display: none; }
    .login-form-panel { padding: 32px 28px 38px; }
}

@media screen and (max-width: 480px) {
    body.login-page { padding: 12px; }
    .login-visual { padding: 28px 22px 24px; }
    .login-form-panel { padding: 26px 20px 32px; }
    .captcha-wrapper { flex-wrap: wrap; }
    .captcha-wrapper input { width: 100%; }
}
