/* ═══════════════════════════════════════════════════════
   base.css — Shared styles for all public Platy pages
   (landing, login, register, forgot/reset password)
═══════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ──────────────────────────────────── */
:root {
    --indigo:    #4f46e5;
    --indigo-d:  #4338ca;
    --indigo-l:  #ede9fe;
    --violet:    #7c3aed;
    --blue:      #2563eb;
    --teal:      #0d9488;
    --amber:     #d97706;

    --gray-50:   #f9fafb;
    --gray-100:  #f3f4f6;
    --gray-200:  #e5e7eb;
    --gray-300:  #d1d5db;
    --gray-400:  #9ca3af;
    --gray-500:  #6b7280;
    --gray-700:  #374151;
    --gray-900:  #111827;

    --green:     #16a34a;
    --green-l:   #dcfce7;
    --red:       #dc2626;
    --red-l:     #fee2e2;
    --yellow-l:  #fef9c3;
    --yellow:    #a16207;

    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 4px 24px rgba(0,0,0,0.07);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
}

/* ── Base ────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-900);
    line-height: 1.6;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ── Logo ────────────────────────────────────────────── */
.platy-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.platy-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--indigo);
    color: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}
.platy-logo-icon.sm { width: 28px; height: 28px; font-size: 14px; border-radius: 7px; }

.platy-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .15s, border-color .2s, color .2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--indigo);
    color: #fff;
}
.btn-primary:hover { background: var(--indigo-d); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-200);
}
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); }

.btn-white {
    background: #fff;
    color: var(--indigo);
}
.btn-white:hover { transform: translateY(-2px); }

.btn-full { width: 100%; }

.btn-lg { padding: 13px 28px; font-size: 1rem; }

/* ── Form controls ───────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--gray-900);
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
/* ── Password toggle wrapper ─────────────────────────── */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrap .form-input {
    padding-right: 42px;
}
.pwd-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    transition: color .15s;
}
.pwd-toggle:hover { color: var(--gray-700); }

.form-input::placeholder { color: var(--gray-400); }
.form-input:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.form-input.field-invalid {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}
.form-input.field-invalid:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.18);
}

/* ── Inline field error message ──────────────────────── */
.field-error {
    display: none;
    font-size: 0.78rem;
    color: var(--yellow);
    margin-top: 4px;
    padding-left: 2px;
}

/* ── Terms consent checkbox ──────────────────────────── */
.consent-wrap { display: flex; flex-direction: column; gap: 0; }

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.consent-check {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--indigo);
    outline-offset: 2px;
}
.consent-check.field-invalid {
    outline: 2px solid var(--amber);
    border-radius: 2px;
}

.consent-label {
    font-size: 0.855rem;
    color: var(--gray-500);
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}
.consent-label a {
    color: var(--indigo);
    text-decoration: none;
}
.consent-label a:hover { text-decoration: underline; }

/* ── Feedback alerts ─────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
}
.alert-success { background: var(--green-l);  color: var(--green);  border: 1px solid #bbf7d0; }
.alert-danger  { background: var(--red-l);    color: var(--red);    border: 1px solid #fecaca; }
.alert-warning { background: var(--yellow-l); color: var(--yellow); border: 1px solid #fef08a; }

/* ── Shared public header (logo-only) ────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--indigo);
    color: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}
.logo-icon.small { width: 28px; height: 28px; font-size: 14px; border-radius: 7px; }

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

/* ── Shared public footer ────────────────────────────── */
.site-footer {
    background: var(--gray-900);
    padding: 24px 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand .logo-text { font-size: 16px; color: #fff; }

.footer-links { display: flex; gap: 20px; }
.footer-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.45);
    transition: color .2s;
}
.footer-links a:hover { color: #fff; }

/* ── Auth page layout ────────────────────────────────── */
body.public-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: linear-gradient(160deg, #f5f3ff 0%, #eff6ff 55%, #f0fdf4 100%);
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
}
.auth-footer a {
    color: var(--indigo);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-300);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ── Utility ─────────────────────────────────────────── */
.text-link {
    color: var(--indigo);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.875rem;
}
.text-link:hover { text-decoration: underline; }

/* ── reCAPTCHA disclosure (replaces floating badge) ─────── */
.grecaptcha-badge { visibility: hidden !important; }

.recaptcha-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    font-size: 0.75rem;
    color: var(--gray-500);
}
.recaptcha-notice img { flex-shrink: 0; opacity: .7; }
.recaptcha-notice a { color: var(--gray-500); text-decoration: underline; }
.recaptcha-notice a:hover { color: var(--gray-700); }

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}
