/* ============================================================
   Temple Management — Authentication pages
   Split-screen on desktop (hero left, form right).
   Stacks on tablet/mobile. Fully responsive.
   ============================================================ */

:root {
    --tm-primary:      #b45309;
    --tm-primary-dark: #78350f;
    --tm-accent:       #7c2d12;
    --tm-bg:           #fff7ed;
    --tm-surface:      #ffffff;
    --tm-text:         #1f2937;
    --tm-text-muted:   #6b7280;
    --tm-border:       #e5e7eb;
    --tm-danger:       #b91c1c;
    --tm-success:      #15803d;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body.tm-auth {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--tm-text);
    background: #fff;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ── Split container ─────────────────────────── */
.tm-auth-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── Hero (left) ─────────────────────────────── */
.tm-auth-hero {
    flex: 1 1 58%;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(120,53,15,.45) 0%, rgba(180,83,9,.25) 100%),
        url('/images/temple-hero.svg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px 56px;
    color: #fff;
}

.tm-auth-hero-quote {
    position: relative;
    z-index: 2;
    max-width: 520px;
}
.tm-auth-hero-quote h1 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 18px 0;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.tm-auth-hero-quote p {
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    color: rgba(255,255,255,.92);
    text-shadow: 0 1px 6px rgba(0,0,0,.25);
}
.tm-auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,.25);
}
.tm-auth-hero-badge .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #86efac;
}

.tm-auth-hero-brand {
    position: absolute;
    top: 32px; left: 48px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.tm-auth-hero-brand .logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.tm-auth-hero-brand .name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .3px;
}

/* ── Form panel (right) ──────────────────────── */
.tm-auth-panel {
    flex: 1 1 42%;
    min-height: 100vh;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
}

.tm-auth-form-wrap {
    width: 100%;
    max-width: 420px;
}

.tm-auth-form-header {
    margin-bottom: 28px;
}
.tm-auth-form-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: var(--tm-primary-dark);
    letter-spacing: -.3px;
}
.tm-auth-form-header p {
    font-size: 14px;
    color: var(--tm-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ── Form elements ───────────────────────────── */
.tm-form-group { margin-bottom: 18px; }

.tm-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--tm-text);
}

.tm-form-control {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid var(--tm-border);
    border-radius: 10px;
    background: #fafafa;
    color: var(--tm-text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.tm-form-control:focus {
    outline: none;
    border-color: var(--tm-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.tm-btn-primary {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #b45309, #78350f);
    color: #fff;
    cursor: pointer;
    transition: transform .08s, box-shadow .15s;
    box-shadow: 0 4px 12px rgba(180, 83, 9, .2);
    -webkit-tap-highlight-color: transparent;
    letter-spacing: .3px;
}
.tm-btn-primary:hover { box-shadow: 0 8px 20px rgba(180, 83, 9, .32); }
.tm-btn-primary:active { transform: translateY(1px); }
.tm-btn-primary:disabled { opacity: .7; cursor: not-allowed; }

.tm-auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--tm-text-muted);
}
.tm-auth-footer a {
    color: var(--tm-primary);
    font-weight: 600;
    text-decoration: none;
}
.tm-auth-footer a:hover { text-decoration: underline; }

.tm-auth-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -6px;
    margin-bottom: 22px;
    font-size: 13px;
}
.tm-auth-footer-row a {
    color: var(--tm-primary);
    font-weight: 600;
    text-decoration: none;
}
.tm-auth-footer-row a:hover { text-decoration: underline; }

.tm-form-check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tm-text-muted);
    user-select: none;
}
.tm-form-check-inline input {
    width: 16px; height: 16px; accent-color: var(--tm-primary);
}

.tm-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: none;
    line-height: 1.4;
}
.tm-alert.show { display: block; }
.tm-alert-danger  { background: #fee2e2; color: var(--tm-danger);  border: 1px solid #fca5a5; }
.tm-alert-success { background: #dcfce7; color: var(--tm-success); border: 1px solid #86efac; }

.tm-password-wrap { position: relative; }
.tm-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tm-text-muted);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    min-height: 40px;
    letter-spacing: .5px;
}
.tm-password-toggle:hover { color: var(--tm-primary); }

/* ── Tablet (768-991px) — 50/50 split ────────── */
@media (min-width: 768px) and (max-width: 991.98px) {
    .tm-auth-hero { flex: 0 0 45%; padding: 40px; }
    .tm-auth-hero-quote h1 { font-size: 30px; }
    .tm-auth-panel { flex: 0 0 55%; padding: 40px 28px; }
    .tm-auth-hero-brand { top: 24px; left: 32px; }
}

/* ── Mobile (<768px) — stack vertically ──────── */
@media (max-width: 767.98px) {
    body.tm-auth { flex-direction: column; overflow-y: auto; }
    .tm-auth-split { flex-direction: column; min-height: auto; }

    .tm-auth-hero {
        flex: 0 0 auto;
        min-height: 200px;
        padding: 24px 24px 28px;
        justify-content: flex-end;
    }
    .tm-auth-hero-quote { max-width: 100%; }
    .tm-auth-hero-quote h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    .tm-auth-hero-quote p { font-size: 13px; }
    .tm-auth-hero-brand {
        top: 18px; left: 20px;
    }
    .tm-auth-hero-brand .logo { width: 36px; height: 36px; font-size: 18px; }
    .tm-auth-hero-brand .name { font-size: 15px; }
    .tm-auth-hero-badge { display: none; }

    .tm-auth-panel {
        flex: 1 1 auto;
        min-height: auto;
        padding: 28px 20px 32px;
    }
    .tm-auth-form-header h2 { font-size: 22px; }
    .tm-auth-form-wrap { max-width: 100%; }
}

/* ── Very small phones ──────────────────────── */
@media (max-width: 360px) {
    .tm-auth-hero { min-height: 160px; padding: 20px; }
    .tm-auth-hero-quote h1 { font-size: 19px; }
    .tm-auth-panel { padding: 24px 16px; }
}
