/* Theme variables - the whole dark slate/teal palette lives here so a
   future white-label/alternate theme is a matter of overriding these,
   not hunting down hardcoded hex codes across templates. */
:root {
    --color-bg: #0f172a;           /* Slate-900 */
    --color-card: #1e293b;         /* Slate-800 */
    --color-border: #334155;       /* Slate-700 */
    --color-border-hover: #475569; /* Slate-600 */
    --color-text: #f1f5f9;         /* Slate-100 */
    --color-text-muted: #94a3b8;   /* Slate-400 */
    --color-text-subtle: #6c757d;
    --color-text-faint: #a0aec0;
    --color-accent: #0d9488;       /* Teal-600 */
    --color-accent-hover: #0f766e; /* Teal-700 */
    --color-error-bg: #451a1a;
    --color-error-text: #fca5a5;
    --color-error-border: #7f1d1d;
    --color-success-bg: #e6fffa;
    --color-success-text: #319795;
    --color-success-border: #b2f5ea;
}

/* Base scaling */
html {
    font-size: 16px; /* Explicit base */
    background-color: var(--color-bg); /* Locks background color early to stop light flashbangs */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* Responsive typography */
h1 { font-size: 2.25rem; color: #ffffff; }
h2 { font-size: 1.85rem; color: #f8fafc; }
p, li, div { font-size: 1.1rem; } /* Bumping standard text up slightly for PC */

@media (max-width: 768px) {
    html {
        font-size: 14px; /* Scales everything down slightly for smaller mobile screens */
    }
}

/* Custom smooth transitions */
a, button {
    transition: all 0.2s ease-in-out;
}

/* Better form inputs for mobile (Slate Dark Theme Matching) */
input, select, textarea {
    appearance: none;
    width: 100%;
    padding: 12px;
    background-color: var(--color-card);
    color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dark theme optimized custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-hover);
}

/* Login/Auth Specific Layout Styling */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh; /* Centers the card vertically below the nav bar */
}

/* Modifier for multi-card auth pages (e.g. profile) that need the full
   viewport height and don't want vertical centering of a single card. */
.login-wrapper--tall {
    min-height: 100vh;
    padding: 40px 20px;
    align-items: flex-start;
}

/* Stacks multiple .login-card blocks vertically with even spacing,
   used on pages with more than one card (e.g. profile: details + security). */
.auth-card-stack {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.login-card {
    background: var(--color-card);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card--flush {
    margin-bottom: 0;
}

.login-header i {
    font-size: 3rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.login-header h1 {
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.error-message {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid var(--color-error-border);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.success-message {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    padding: 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.success-message--bordered {
    border: 1px solid var(--color-success-border);
}

.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    color: white;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-primary {
    width: 100%;
    background: var(--color-accent);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
}

.btn-secondary {
    background: var(--color-text-subtle);
}

/* Small "back to X" / "return to Y" links under an auth card */
.auth-back-link {
    font-size: 0.85rem;
    text-align: center;
    padding-top: 15px;
}

.auth-back-link a {
    color: var(--color-text-subtle);
    text-decoration: none;
    font-weight: 600;
}

/* Variant used when the link sits below other content on the same
   card and needs a visual divider (e.g. profile page). */
.auth-back-link--divided {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.auth-back-link--divided a {
    color: var(--color-text-faint);
}

/* Leaflet bakes a white background + border into every divIcon via its
   own .leaflet-div-icon class, applied alongside any custom className -
   without this reset, that default box sits behind/around a custom
   marker's own styling instead of the marker rendering cleanly on its own. */
.sea-day-marker {
    background: transparent !important;
    border: none !important;
}

/* Profile avatar picker grid */
.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.avatar-picker-option {
    font-size: 1.5rem;
    line-height: 1;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}

.avatar-picker-option:hover {
    border-color: var(--color-border-hover);
    transform: scale(1.05);
}

.avatar-picker-option--selected {
    border-color: var(--color-accent);
    background: var(--color-card);
}
