/* Beer Festival Volunteer Manager – Public Styles */

.bfvm-public-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.bfvm-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    text-align: center;
    max-width: 440px;
    margin: 0 auto;
}
.bfvm-login-icon { font-size: 48px; margin-bottom: 8px; }
.bfvm-login-card h2 { margin: 0 0 8px; color: #1a1a1a; font-size: 22px; }
.bfvm-login-intro { color: #666; margin-bottom: 24px; }
.bfvm-login-note { font-size: 12px; color: #999; margin-top: 20px; }

.bfvm-field { margin-bottom: 16px; text-align: left; }
.bfvm-field label { display: block; font-weight: 600; margin-bottom: 6px; color: #333; font-size: 14px; }
.bfvm-input {
    width: 100%; padding: 10px 14px; border: 1.5px solid #ddd; border-radius: 6px;
    font-size: 15px; box-sizing: border-box; transition: border-color .2s;
}
.bfvm-input:focus { outline: none; border-color: #c0392b; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.bfvm-btn {
    display: inline-block; padding: 12px 24px; border-radius: 6px; font-size: 15px;
    font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent;
    transition: all .2s; line-height: 1;
}
.bfvm-btn-primary { background: #c0392b; color: #fff; border-color: #c0392b; }
.bfvm-btn-primary:hover { background: #a93226; border-color: #a93226; color: #fff; }
.bfvm-btn-secondary { background: #f5f5f5; color: #333; border-color: #ddd; }
.bfvm-btn-secondary:hover { background: #e8e8e8; }
.bfvm-btn-outline { background: transparent; color: #c0392b; border-color: #c0392b; }
.bfvm-btn-outline:hover { background: #c0392b; color: #fff; }
.bfvm-btn-danger { background: transparent; color: #e74c3c; border-color: #e74c3c; }
.bfvm-btn-danger:hover { background: #e74c3c; color: #fff; }
.bfvm-btn-sm { padding: 8px 16px; font-size: 13px; }
.bfvm-btn:disabled, .bfvm-btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ── Messages ───────────────────────────────────────────────────────────── */
.bfvm-message {
    padding: 12px 16px; border-radius: 6px; margin: 16px 0; font-size: 14px;
}
.bfvm-message-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.bfvm-message-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.bfvm-notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.bfvm-notice-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.bfvm-notice-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.bfvm-dashboard { }
.bfvm-dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.bfvm-dashboard-header h2 { margin: 0; font-size: 20px; }

.bfvm-dashboard-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    margin-bottom: 20px;
}
.bfvm-card-no-app { text-align: center; padding: 40px; }

.bfvm-app-status-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.bfvm-app-status-label { font-weight: 600; color: #666; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

.bfvm-status-badge { padding: 5px 14px; border-radius: 20px; font-weight: 700; font-size: 13px; }
.bfvm-status-pending  { background: #fef3cd; color: #856404; }
.bfvm-status-approved { background: #d4edda; color: #155724; }
.bfvm-status-rejected { background: #f8d7da; color: #721c24; }
.bfvm-status-change   { background: #e2d9f3; color: #5a2d82; }
.bfvm-status-withdrawn{ background: #e2e3e5; color: #383d41; }

.bfvm-submitted-at { font-size: 12px; color: #999; margin: 0 0 16px; }
.bfvm-manager-note { background: #fff8e1; border-left: 4px solid #f39c12; padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.bfvm-manager-note strong { display: block; margin-bottom: 4px; color: #856404; font-size: 12px; text-transform: uppercase; }
.bfvm-manager-note p { margin: 0; color: #333; }

.bfvm-session-summary { margin-bottom: 14px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
.bfvm-session-summary-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f8f8f8; font-size: 14px; }
.bfvm-session-summary-header span { color: #888; font-size: 12px; }
.bfvm-role-pills { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.bfvm-role-pill { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.bfvm-role-requested { background: #e8e8e8; color: #555; }
.bfvm-role-approved  { background: #d4edda; color: #155724; }
.bfvm-role-rejected  { background: #f8d7da; color: #721c24; text-decoration: line-through; }
.bfvm-role-tick { margin-left: 4px; }

.bfvm-app-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ── Application form ───────────────────────────────────────────────────── */
.bfvm-apply-wrap h2 { margin-bottom: 6px; }
.bfvm-apply-intro   { color: #666; margin-bottom: 24px; }

.bfvm-apply-day { margin-bottom: 28px; }
.bfvm-apply-day-header { font-size: 16px; color: #c0392b; border-bottom: 2px solid #c0392b; padding-bottom: 6px; margin-bottom: 14px; }

.bfvm-apply-session {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: border-color .2s;
}
.bfvm-apply-session.is-selected { border-color: #c0392b; }

.bfvm-session-toggle { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.bfvm-session-toggle input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: #c0392b; }
.bfvm-session-toggle-label { flex: 1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; }
.bfvm-session-time { font-size: 13px; color: #888; }

.bfvm-role-selection { padding: 0 16px 16px 48px; border-top: 1px solid #f0f0f0; }
.bfvm-role-prompt { font-size: 13px; color: #666; margin: 12px 0 10px; }
.bfvm-role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }

.bfvm-role-option {
    display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px;
    border: 1.5px solid #e0e0e0; border-radius: 6px; cursor: pointer;
    transition: all .15s; background: #fff;
}
.bfvm-role-option:hover { border-color: #c0392b; background: #fff8f8; }
.bfvm-role-option input[type=checkbox] { display: none; }
.bfvm-role-option input:checked ~ .bfvm-role-option-name { color: #c0392b; }
.bfvm-role-option:has(input:checked) { border-color: #c0392b; background: #fff1f1; }
.bfvm-role-option-name { font-weight: 600; font-size: 14px; color: #333; display: inline-flex; align-items: center; gap: 4px; }


.bfvm-apply-submit { margin-top: 28px; padding-top: 20px; border-top: 1px solid #eee; }

/* ── Login: name + email fields ─────────────────────────────────────────── */
.bfvm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .bfvm-field-row { grid-template-columns: 1fr; }
}
.bfvm-required { color: #c0392b; margin-left: 2px; }
.bfvm-btn-full { width: 100%; text-align: center; }

/* ── Application form: sections ─────────────────────────────────────────── */
.bfvm-apply-section {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.bfvm-apply-section-title {
    margin: 0 0 16px;
    font-size: 15px;
    color: #c0392b;
    border-bottom: 2px solid #c0392b;
    padding-bottom: 8px;
}
.bfvm-apply-day { margin-bottom: 12px; }
.bfvm-apply-day-header {
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
    margin: 16px 0 10px;
}

/* ── Custom fields ───────────────────────────────────────────────────────── */
.bfvm-custom-field { margin-bottom: 16px; }
.bfvm-field-label { display: block; font-weight: 600; font-size: 14px; color: #333; margin-bottom: 4px; }
.bfvm-field-desc  { display: block; font-size: 12px; color: #888; margin-bottom: 6px; }
.bfvm-textarea    { min-height: 100px; resize: vertical; }

.bfvm-radio-group, .bfvm-checkbox-group {
    display: flex; flex-direction: column; gap: 6px; margin-top: 4px;
}
.bfvm-radio-option, .bfvm-checkbox-option {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: #333; cursor: pointer;
    padding: 6px 10px; border-radius: 4px; transition: background .15s;
}
.bfvm-radio-option:hover, .bfvm-checkbox-option:hover { background: #f5f5f5; }
.bfvm-radio-option input, .bfvm-checkbox-option input { width: 16px; height: 16px; accent-color: #c0392b; }

.bfvm-checkbox-single {
    display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer;
    padding: 8px 12px; border: 1.5px solid #e0e0e0; border-radius: 6px; transition: border-color .15s;
}
.bfvm-checkbox-single:hover { border-color: #c0392b; }
.bfvm-checkbox-single input { width: 16px; height: 16px; accent-color: #c0392b; }

/* ── Admin: form fields ──────────────────────────────────────────────────── */
.bfvm-drag-handle { cursor: grab; color: #ccc; font-size: 18px; text-align: center; user-select: none; }
.bfvm-drag-handle:active { cursor: grabbing; }

/* ── Text constraint helpers ─────────────────────────────────────────────── */
.bfvm-char-count { display:block; font-size:11px; color:#888; margin-top:3px; }
.bfvm-char-over  { color:#c0392b; font-weight:600; }

/* ── Admin: constraint fields ────────────────────────────────────────────── */
.bfvm-constraints-block { display:flex; flex-direction:column; gap:14px; }
.bfvm-constraint-field label { display:block; margin-bottom:4px; }

/* ── Role info icon & tooltip ────────────────────────────────────────────── */
.bfvm-role-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    user-select: none;
    vertical-align: middle;
}

/* Tooltip bubble — hidden by default */
.bfvm-role-info::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 7px 10px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* Tooltip arrow */
.bfvm-role-info::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
}

/* Show on desktop hover */
@media (hover: hover) {
    .bfvm-role-info:hover::after,
    .bfvm-role-info:hover::before,
    .bfvm-role-info:focus::after,
    .bfvm-role-info:focus::before {
        opacity: 1;
    }
}

/* Show when JS adds .is-open (mobile tap) */
.bfvm-role-info.is-open::after,
.bfvm-role-info.is-open::before {
    opacity: 1;
}

/* Flip tooltip below if it would overflow top of viewport */
.bfvm-role-info.tooltip-below::after {
    bottom: auto;
    top: calc(100% + 8px);
}
.bfvm-role-info.tooltip-below::before {
    bottom: auto;
    top: calc(100% + 2px);
    border-top-color: transparent;
    border-bottom-color: #1a1a1a;
}

/* ── Role group labels on apply form ─────────────────────────────────────── */
.bfvm-role-group-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #c0392b;
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0ddd d;
}
.bfvm-role-group-label:first-child { margin-top: 4px; }
