/* ── Friend Resto Reservations — Public Styles ──────────────────────────── */
/* All selectors are scoped to .frr-wrap to avoid any cascade bleed.        */

.frr-wrap {
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
}

.frr-form-title {
    margin-bottom: 1.2em;
}

.frr-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.frr-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    flex: 1 1 100%;
}

.frr-half {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 160px;
}

.frr-field label {
    font-weight: 600;
    margin-bottom: .35rem;
    font-size: .9rem;
}

.frr-req {
    color: #c0392b;
}

.frr-field input,
.frr-field select,
.frr-field textarea {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: .5rem .65rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}

.frr-field input:focus,
.frr-field select:focus,
.frr-field textarea:focus {
    outline: none;
    border-color: #2c7a4b;
    box-shadow: 0 0 0 2px rgba(44,122,75,.15);
}

.frr-btn {
    background: #2c7a4b;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: .65rem 1.4rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
}

.frr-btn:hover { background: #235f3b; }
.frr-btn:disabled { opacity: .6; cursor: not-allowed; }

.frr-response {
    padding: .8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 600;
    display: none; /* always hidden until JS shows it — prevents cached visible state */
}

.frr-response.frr-success {
    background: #eaf6ee;
    color: #1d6136;
    border: 1px solid #a3d9b4;
}

.frr-response.frr-error {
    background: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6c4;
}

/* ── Custom calendar picker ─────────────────────────────────────────────── */

.frr-cal-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: .5rem .65rem;
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s;
    min-height: 2.4rem;
}
.frr-cal-trigger:focus,
.frr-cal-trigger:hover {
    border-color: #2c7a4b;
    box-shadow: 0 0 0 2px rgba(44,122,75,.15);
    outline: none;
}
.frr-cal-display  { color: #444; }
.frr-cal-icon     { font-size: 1.1rem; margin-left: .5rem; }

/* Calendar popup */
.frr-calendar {
    display: none;
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
    width: 300px;
    padding: .5rem;
    margin-top: 4px;
}
.frr-calendar.frr-cal-open-state { display: block; }

/* Ensure the field wrapper is a positioning context */
.frr-field { position: relative; }

/* Header */
.frr-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .3rem .2rem .5rem;
}
.frr-cal-title {
    font-weight: 700;
    font-size: .95rem;
    color: #222;
}
.frr-cal-nav {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #2c7a4b;
    padding: 0 .4rem;
    border-radius: 3px;
    transition: background .1s;
}
.frr-cal-nav:hover { background: #f0f0f0; }

/* Grid */
.frr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* Weekday headers */
.frr-cal-wh {
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: #888;
    padding: .25rem 0;
    text-transform: uppercase;
}

/* Day cells */
.frr-cal-cell {
    text-align: center;
    border-radius: 4px;
    padding: .35rem .1rem;
    font-size: .88rem;
    cursor: default;
    line-height: 1.6;
}
.frr-cal-empty { background: transparent; }

/* Past days */
.frr-cal-past {
    color: #ccc;
}

/* Closed / not-open-that-weekday */
.frr-cal-closed {
    color: #bbb;
    background: #f5f5f5;
    text-decoration: line-through;
    position: relative;
}
.frr-cal-closed:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: .72rem;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 100;
}

/* Open days */
.frr-cal-open {
    color: #222;
    cursor: pointer;
    font-weight: 500;
}
.frr-cal-open:hover {
    background: #e8f5e9;
    color: #1d6f2e;
}

/* Today */
.frr-cal-today {
    border: 2px solid #2c7a4b;
}

/* Selected */
.frr-cal-selected,
.frr-cal-open.frr-cal-selected {
    background: #2c7a4b !important;
    color: #fff !important;
    font-weight: 700;
}
