/* Maine Pottery Co — The Potter's Mailbox */
/* Mobile-first, large text & touch targets for older users */
/* Brand palette from style guide */

:root {
    --olive: #59543A;
    --red: #964032;
    --sage: #A4A18A;
    --terracotta: #B66D60;
    --tan: #C7A698;
    --cream: #EAEADC;
    --dark-red: #7F4536;
    --border: #C7A698;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--cream);
    color: var(--olive);
    line-height: 1.7;
    min-height: 100vh;
    font-size: 1.15rem;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

/* Flash messages */
.flash {
    background: #F5EDE8;
    border: 2px solid var(--terracotta);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.flash p {
    color: var(--red);
}

/* Scene layout — mobile: stacked, desktop: positioned like the mockup */
.scene {
    position: relative;
    text-align: center;
}

/* Mobile: stacked layout */
.scene-logo {
    max-width: 280px;
    margin: 0 auto 1rem;
}

.scene-logo img {
    width: 100%;
    height: auto;
}

.scene-schoolhouse {
    width: 50%;
    max-width: 260px;
    height: auto;
    margin-bottom: 0.5rem;
}

.scene-mailbox {
    width: 40%;
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.scene-form-card {
    position: relative;
    z-index: 1;
}

.note-card {
    border: 1px solid var(--tan);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 0 auto 1.5rem;
    max-width: 420px;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--olive);
    line-height: 1.6;
    background: #F5EDE8;
    box-shadow: 0 3px 10px rgba(89, 84, 58, 0.12);
    transform: rotate(-1.5deg);
}

.subtitle {
    color: var(--olive);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Photo placeholders (kept for Chris photos) */
.photo-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--tan);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

.photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder.small {
    width: 120px;
    height: 120px;
    border-radius: 10px;
}

.placeholder-text {
    color: var(--dark-red);
    font-size: 0.9rem;
    font-style: italic;
}

.shop-photos {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
}

/* Spots remaining */
.spots-remaining {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--olive);
    font-size: 1.1rem;
}

.spots-remaining .count {
    font-weight: bold;
    color: var(--red);
    font-size: 1.25rem;
}

/* Form fields */
.field {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--olive);
}

.hint {
    font-weight: normal;
    color: var(--sage);
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--tan);
    border-radius: 10px;
    font-family: Georgia, serif;
    font-size: 1.15rem;
    color: var(--olive);
    background: white;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--red);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

/* Buttons — big, easy to tap */
.btn {
    display: block;
    width: 100%;
    background: var(--red);
    color: var(--cream);
    border: none;
    padding: 1.1rem 2rem;
    border-radius: 12px;
    font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    background: var(--dark-red);
}

.btn:active {
    background: #6A3225;
}

.btn-secondary {
    background: transparent;
    color: var(--olive);
    border: 2px solid var(--tan);
}

.btn-secondary:hover {
    background: var(--tan);
    color: white;
}

.btn-secondary:active {
    background: var(--terracotta);
    color: white;
}

/* Success / Queue full */
.success-message,
.queue-full,
.all-done {
    text-align: center;
    padding: 2.5rem 0;
}

.success-message h2,
.queue-full h2,
.all-done h2 {
    font-weight: normal;
    font-style: italic;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--olive);
}

.success-message p,
.queue-full p,
.all-done p {
    margin-bottom: 1rem;
    color: var(--olive);
    font-size: 1.1rem;
}

.note {
    font-size: 1.1rem;
    color: var(--olive);
    margin-top: 1.75rem;
    text-align: center;
    font-style: italic;
    line-height: 1.6;
}

/* Portal styles */
.portal-logo {
    max-width: 200px;
    margin: 0 auto 1rem;
}

.portal-logo img {
    width: 100%;
    height: auto;
}

.portal h1 {
    font-weight: normal;
    font-style: italic;
    font-size: 1.7rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--olive);
}

.message-count {
    text-align: center;
    color: var(--sage);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.message-card {
    background: white;
    border: 2px solid var(--tan);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.message-from {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--cream);
}

.message-from strong {
    font-size: 1.2rem;
    color: var(--olive);
}

.message-from .email {
    display: block;
    color: var(--sage);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Chris portal — iPad-optimized, big and easy to use */
.chris-portal {
    max-width: 600px;
    margin: 0 auto;
}

.chris-portal .portal-logo {
    max-width: 220px;
    margin: 0 auto 1.5rem;
}

.chris-portal .message-count {
    font-size: 1.25rem;
    color: var(--olive);
    margin-bottom: 2rem;
    font-style: italic;
}

.chris-portal .message-card {
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 2px solid var(--tan);
    box-shadow: 0 3px 12px rgba(89, 84, 58, 0.08);
}

.chris-portal .message-from strong {
    font-size: 1.4rem;
}

.chris-portal .message-from .email {
    font-size: 1.05rem;
}

.chris-portal .message-body {
    font-size: 1.6rem;
    line-height: 1.85;
    white-space: pre-wrap;
    color: var(--olive);
}

.chris-portal .message-date {
    font-size: 1rem;
    margin-top: 1.25rem;
}

.chris-portal .btn {
    padding: 1.35rem 2rem;
    font-size: 1.4rem;
    border-radius: 14px;
}

.chris-portal .btn-secondary {
    font-size: 1.4rem;
}

.chris-portal .actions {
    gap: 1rem;
    margin-top: 1.5rem;
}

.chris-portal textarea {
    font-size: 1.35rem;
    min-height: 220px;
    padding: 1.25rem;
}

.chris-portal label {
    font-size: 1.25rem;
}

.chris-portal h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.chris-portal .all-done h2 {
    font-size: 2rem;
}

.chris-portal .all-done p {
    font-size: 1.25rem;
}

/* Brad portal */
.brad-portal .message-body {
    font-size: 1.15rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.message-date {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--sage);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* History & Export */
.history-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.history-actions .btn,
.history-actions .btn-secondary {
    width: auto;
    flex: 1;
}

.status-badge {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: 0.5rem;
    font-style: normal;
    vertical-align: middle;
}

.status-pending { background: #FFF0E0; color: var(--terracotta); }
.status-replied { background: #E8F5E8; color: #3A6B3A; }
.status-auto_replied { background: #E8F5E8; color: #3A6B3A; }
.status-passed_to_brad { background: #FFF0E0; color: var(--terracotta); }

.response-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--tan);
}

.response-text {
    white-space: pre-wrap;
    margin-top: 0.5rem;
    color: var(--olive);
    font-style: italic;
}

/* File input — big and friendly */
input[type="file"] {
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--tan);
    border-radius: 10px;
    font-family: Georgia, serif;
    font-size: 1.05rem;
    color: var(--olive);
    background: white;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--red);
    color: var(--cream);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-family: Georgia, serif;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 0.75rem;
}

.field-note {
    font-size: 1.1rem;
    color: var(--olive);
    margin-top: 0.4rem;
    font-style: italic;
    line-height: 1.6;
}

/* Media display in message cards */
.message-media {
    margin-top: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.message-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.message-media video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background: #000;
}

/* QR code page */
.qr-page {
    text-align: center;
    padding: 1rem 0;
}

.qr-page .hero-logo {
    max-width: 240px;
    margin-bottom: 1.5rem;
}

.qr-page .subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.qr-code {
    margin: 0 auto 1.5rem;
}

.qr-code img {
    width: 280px;
    height: 280px;
    border-radius: 12px;
}

.qr-url {
    font-size: 1rem;
    color: var(--sage);
    word-break: break-all;
}

/* Desktop — scene layout matching mockup */
@media (min-width: 768px) {
    .container {
        max-width: 900px;
        padding: 2rem;
    }

    .scene {
        position: relative;
        padding: 0 0 3rem;
    }

    /* Logo text — above the form, left-aligned */
    .scene-logo {
        position: relative;
        max-width: 260px;
        margin: 0 0 1rem 0;
        text-align: left;
        z-index: 3;
    }

    /* Schoolhouse — top right, overlapping form card */
    .scene-schoolhouse {
        position: absolute;
        top: -2rem;
        right: 2%;
        width: 340px;
        max-width: 340px;
        z-index: 2;
    }

    /* Mailbox — anchored to bottom of form, left side */
    .scene-mailbox {
        position: absolute;
        bottom: 0;
        left: -1rem;
        width: 280px;
        max-width: 280px;
        z-index: 2;
        margin: 0;
    }

    /* Form card — center/right, tighter */
    .scene-form-card {
        position: relative;
        margin-left: 30%;
        margin-top: 0;
        width: 58%;
        background: white;
        border-radius: 8px;
        padding: 1.5rem 2rem;
        box-shadow: 0 4px 20px rgba(89, 84, 58, 0.1);
        z-index: 1;
    }

    /* Tighten form spacing on desktop */
    .scene-form-card .field {
        margin-bottom: 1rem;
    }

    .scene-form-card .note-card {
        margin-bottom: 1rem;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .scene-form-card .spots-remaining {
        margin-bottom: 1rem;
    }

    .scene-form-card input[type="text"],
    .scene-form-card input[type="email"],
    .scene-form-card textarea {
        padding: 0.7rem;
        font-size: 1rem;
    }

    .scene-form-card textarea {
        min-height: 100px;
    }

    .scene-form-card label {
        font-size: 1rem;
        margin-bottom: 0.35rem;
    }

    .scene-form-card .note {
        margin-top: 1rem;
    }

    .note-card {
        margin: 0 0 1.5rem;
        max-width: none;
    }

    .photo-placeholder {
        width: 200px;
        height: 200px;
    }

    .actions {
        flex-direction: row;
        justify-content: center;
    }

    .actions .btn {
        width: auto;
        min-width: 200px;
    }

    .chris-portal .message-body {
        font-size: 1.65rem;
    }
}
