/**
 * Reservation Form Styles - Asinello Pizzeria
 * Dark theme matching site identity
 * Brand: gold #cda45e, dark #0c0b09, Playfair Display + Poppins + Open Sans
 */

/* ===== CSS Reset & Base ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --gold: #cda45e;
    --gold-hover: #d9ba85;
    --gold-light: #d3af71;
    --bg-body: #0c0b09;
    --bg-card: #1a1814;
    --bg-input: #0c0b09;
    --border: #625b4b;
    --border-subtle: #37332a;
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --text-placeholder: #a49b89;
    --error: #ed3c0d;
    --success: #18d26e;
}

html {
    font-size: 16px;
}

body {
    font-family: "Open Sans", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px 10px;
}

/* ===== Container ===== */
.reservation-container {
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Header ===== */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
}

.brand-logo {
    display: inline-block;
    margin-bottom: 1rem;
}

.brand-logo img {
    height: 65px;
    width: auto;
    transition: opacity 0.3s;
}

.brand-logo:hover img {
    opacity: 0.8;
}

.page-header h1 {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    color: var(--gold);
    margin: 0;
    font-weight: 700;
}

/* ===== Form Container ===== */
#reservation-form {
    background: var(--bg-card);
    padding: 2rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.2);
}

/* ===== Form Groups ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--gold);
}

.required {
    color: var(--gold);
    font-weight: 700;
}

/* ===== Input Styles ===== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(205, 164, 94, 0.15);
}

/* Date input: cursor pointer (click anywhere opens picker) */
input[type="date"] {
    cursor: pointer;
}

/* Date input coloring for dark bg */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Select arrow coloring */
select {
    appearance: auto;
}

/* Invalid state (after user interaction) */
input:invalid:not(:placeholder-shown),
select:invalid:not(:focus),
textarea:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

/* Disabled state */
input:disabled,
select:disabled,
textarea:disabled {
    background: #151311;
    cursor: not-allowed;
    opacity: 0.5;
    border-color: var(--border-subtle);
}

/* Hints */
.hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Textarea */
textarea {
    resize: vertical;
    min-height: 100px;
}

/* Character Counter */
.char-counter {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: var(--gold);
    font-weight: 600;
}

/* ===== Time Slots Container ===== */
.slots-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-height: 60px;
}

.slots-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: rgba(205, 164, 94, 0.05);
    border-radius: 4px;
    border: 2px dashed var(--border);
}

/* Slot Buttons */
.slot-btn {
    padding: 14px 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    border: 2px solid var(--gold);
    border-radius: 50px;
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-btn:hover:not(:disabled):not(.unavailable) {
    background: var(--gold);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(205, 164, 94, 0.25);
}

.slot-btn:active:not(:disabled):not(.unavailable) {
    transform: translateY(0);
}

.slot-btn.selected {
    background: var(--gold);
    color: #1a1814;
    border-color: var(--gold);
    font-weight: 700;
}

.slot-btn.selected::after {
    content: " \2713";
    margin-left: 4px;
}

.slot-btn.unavailable,
.slot-btn:disabled {
    background: transparent;
    color: #555;
    cursor: not-allowed;
    border-color: var(--border-subtle);
    font-weight: 400;
    text-decoration: line-through;
    opacity: 0.5;
}

.slot-btn.unavailable:hover {
    transform: none;
    box-shadow: none;
}

/* Loading state */
.slots-container.loading {
    opacity: 0.6;
    cursor: wait;
    position: relative;
}

.slots-container.loading::after {
    content: "Chargement...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    color: var(--gold);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ===== Checkbox Group ===== */
.checkbox-group {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    margin-top: 0.2rem;
    cursor: pointer;
    flex-shrink: 0;
    transform: scale(1.2);
    accent-color: var(--gold);
}

.checkbox-label span {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.checkbox-label a {
    color: var(--gold);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.checkbox-label a:hover {
    color: var(--gold-hover);
}

/* ===== Honeypot Field (Hidden) ===== */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ===== Submit Button ===== */
.submit-btn {
    width: 100%;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    background: var(--gold);
    color: white;
    border: 2px solid var(--gold);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover:not(:disabled) {
    background: var(--gold-light);
    border-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(205, 164, 94, 0.3);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: transparent;
    border-color: var(--border);
    color: var(--border);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ===== Message Container ===== */
.message-container {
    margin-top: 1.5rem;
    padding: 15px 18px;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-container.hidden {
    display: none;
}

.message-container.success {
    background: rgba(24, 210, 110, 0.1);
    color: var(--success);
    border: 1px solid rgba(24, 210, 110, 0.3);
}

.message-container.error {
    background: rgba(237, 60, 13, 0.1);
    color: #ff6b47;
    border: 1px solid rgba(237, 60, 13, 0.3);
}

.message-container.info {
    background: rgba(205, 164, 94, 0.1);
    color: var(--gold);
    border: 1px solid rgba(205, 164, 94, 0.3);
}

/* ===== Footer ===== */
.form-footer {
    margin-top: 2rem;
    text-align: center;
    padding: 1.5rem 1rem;
}

.form-footer p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== Accessibility - Focus Visible ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

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

/* Tablet: 576px+ */
@media (min-width: 576px) {
    body {
        padding: 40px 20px;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    #reservation-form {
        padding: 2.5rem 2rem;
    }

    .slots-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .slot-btn {
        font-size: 1rem;
    }
}

/* Desktop: 768px+ */
@media (min-width: 768px) {
    .page-header {
        padding: 2rem 1.5rem;
    }

    .page-header h1 {
        font-size: 3rem;
    }

    #reservation-form {
        padding: 3rem 2.5rem;
    }

    .slots-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

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

    .submit-btn {
        padding: 16px 32px;
        font-size: 1.15rem;
    }
}

/* Large Desktop: 992px+ */
@media (min-width: 992px) {
    .reservation-container {
        max-width: 700px;
    }

    .slots-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== Confirmation Page ===== */
.confirmation-card {
    background: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: 4px;
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.2);
    text-align: center;
}

.confirmation-icon {
    margin-bottom: 1.5rem;
}

.checkmark-svg {
    width: 72px;
    height: 72px;
}

.checkmark-circle {
    stroke: var(--gold);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke-circle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--gold);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke-check 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes stroke-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes stroke-check {
    to { stroke-dashoffset: 0; }
}

.confirmation-title {
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    color: var(--gold);
    margin: 0 0 1.25rem 0;
    font-weight: 700;
}

.confirmation-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    margin: 0 0 1rem 0;
}

.confirmation-text strong {
    color: var(--gold);
}

.confirmation-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 2rem 0;
}

.confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.confirmation-btn-primary {
    display: block;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    background: var(--gold);
    color: #1a1814;
    border: 2px solid var(--gold);
    border-radius: 50px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.confirmation-btn-primary:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(205, 164, 94, 0.3);
    color: #1a1814;
}

.confirmation-btn-secondary {
    display: block;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: "Poppins", sans-serif;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border);
    border-radius: 50px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.confirmation-btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold-hover);
    transform: translateY(-1px);
}

@media (min-width: 576px) {
    .confirmation-card {
        padding: 3.5rem 2.5rem;
    }

    .confirmation-title {
        font-size: 2.5rem;
    }

    .confirmation-actions {
        flex-direction: row;
        max-width: none;
        justify-content: center;
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
        color: #333;
    }

    .submit-btn,
    .message-container {
        display: none;
    }

    #reservation-form {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
