/**
 * Opito Theme — Mobile-first coastal CSS
 *
 * Color palette:
 *   Header blue:   #2c5f7c
 *   Light bg:      #e8f0f6
 *   Warm bg:       #f5f0e8
 *   Sandy accent:  #c4a97d
 *   Card white:    #ffffff
 *   Body text:     #333333
 *   Muted text:    #7a8a9a
 *   Border:        #dde3e8
 *
 * Status palette (shared with plugin CSS via custom properties):
 *   Pending:       #e67e22
 *   Approved:      #27ae60
 *   Declined:      #c0392b
 */

/* ============================================================
   CSS Custom Properties — shared palette
   Plugin CSS must reference these variables, not hardcode hex.
   ============================================================ */

:root {
    /* Brand */
    --opito-blue:       #2c5f7c;
    --opito-blue-light: #5a9bb5;
    --opito-bg:         #e8f0f6;
    --opito-bg-warm:    #f5f0e8;
    --opito-sandy:      #c4a97d;

    /* Neutrals */
    --opito-white:      #ffffff;
    --opito-text:       #333333;
    --opito-muted:      #7a8a9a;
    --opito-border:     #dde3e8;
    --opito-info-bg:    #f0f4f8;

    /* Status */
    --opito-pending:    #e67e22;
    --opito-approved:   #27ae60;
    --opito-declined:   #c0392b;
    --opito-declined-bg:#fdf0ee;

    /* Action blue (calendar nav, submit button) */
    --opito-blue-action:       #2c6fad;
    --opito-blue-action-dark:  #1a5490;
    --opito-blue-action-bg:    #e8f0fb;

    /* Heading and muted text */
    --opito-heading:           #2c3e50;
    --opito-muted-dark:        #555555;

    /* Calendar state backgrounds */
    --opito-bg-subtle:         #fafafa;
    --opito-approved-bg:       #c8e6c9;
    --opito-approved-bg-hover: #a5d6a7;
    --opito-approved-text:     #1b5e20;
    --opito-pending-bg:        #fff3cd;
    --opito-pending-bg-hover:  #ffe69c;
    --opito-pending-text:      #7d5a00;
    --opito-blocked-bg:        #e2e3e5;

    /* Status messages */
    --opito-success-bg:        #d4edda;
    --opito-success-border:    #c3e6cb;
    --opito-success-text:      #155724;
    --opito-error-bg:          #f8d7da;
    --opito-error-border:      #f5c6cb;
    --opito-error-text:        #721c24;

    /* Declined variant */
    --opito-declined-dark:     #922b21;

    /* Spacing */
    --opito-radius-sm:  4px;
    --opito-radius:     6px;
    --opito-radius-lg:  8px;
    --opito-shadow:     0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   Base
   ============================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #e8f0f6;
}

a {
    color: #2c5f7c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   Site Header (logged-in pages)
   ============================================================ */

.site-header {
    background: #2c5f7c;
    color: #fff;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

.logout-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-decoration: none;
}

.logout-link:hover {
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   Site Content
   ============================================================ */

.site-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 16px 80px; /* bottom padding clears fixed tab bar */
}

/* ============================================================
   Entry / Page Content
   ============================================================ */

.entry-title {
    color: #2c5f7c;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.entry-content {
    font-size: 15px;
    line-height: 1.7;
}

.entry-content p {
    margin: 0 0 12px;
}

/* ============================================================
   Info Page List
   ============================================================ */

.info-page-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info-page-list__item {
    padding: 14px 0;
    border-bottom: 1px solid #dde3e8;
    font-size: 16px;
}

.info-page-list__item:first-child {
    border-top: 1px solid #dde3e8;
}

.info-page-list__item a {
    color: #2c5f7c;
    font-weight: 500;
    display: block;
}

.info-page-list__item a:hover {
    text-decoration: underline;
}

/* ============================================================
   Cards (generic utility)
   ============================================================ */

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 12px;
}

/* ============================================================
   Bottom Tab Bar
   ============================================================ */

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #dde3e8;
    z-index: 100;
    /* iPhone safe area */
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 6px;
    font-size: 11px;
    color: #7a8a9a;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease;
}

.tab-bar__item:hover,
.tab-bar__item:focus {
    color: #2c5f7c;
    text-decoration: none;
}

.tab-bar__item.is-active {
    color: #2c5f7c;
    font-weight: 600;
}

.tab-bar__icon {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
    flex-shrink: 0;
}

/* ============================================================
   Splash Screen
   ============================================================ */

body.front-page-splash {
    background: linear-gradient(135deg, #2c5f7c 0%, #5a9bb5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c5f7c 0%, #5a9bb5 100%);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.splash-screen.splash-hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-welcome {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin: 0;
    text-align: center;
}

/* ============================================================
   Login Panel
   ============================================================ */

.login-panel {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.login-panel.login-visible {
    opacity: 1;
}

.login-panel[hidden] {
    display: none;
}

.login-panel__heading {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 24px;
    letter-spacing: 0.02em;
}

/* WordPress login form styles */
.login-panel #loginform {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.login-panel .login-username,
.login-panel .login-password,
.login-panel .login-remember {
    margin-bottom: 12px;
}

.login-panel label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.login-panel input[type="text"],
.login-panel input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 16px; /* 16px prevents iOS auto-zoom */
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    margin-bottom: 0;
    -webkit-appearance: none;
    appearance: none;
}

.login-panel input[type="text"]:focus,
.login-panel input[type="password"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.25);
}

.login-panel input[type="text"]::placeholder,
.login-panel input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-panel input[type="submit"] {
    width: 100%;
    padding: 13px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-panel input[type="submit"]:hover,
.login-panel input[type="submit"]:focus {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.9);
    outline: none;
}

.login-panel .login-remember label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.login-panel .login-remember input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Login error messages */
#login_error {
    color: #fff;
    background: rgba(220, 53, 69, 0.4);
    border: 1px solid rgba(220, 53, 69, 0.6);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 768px) {
    body {
        padding: 0 16px;
    }

    .site-content {
        padding-top: 24px;
        padding-bottom: 88px;
    }

    .tab-bar__item {
        font-size: 12px;
    }
}
