/* ============================================
   Help / Ask a Librarian Page
   ============================================ */

.help-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 32px 64px;
}

/* Two-column layout */
.help-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

/* ---- Form Card ---- */

.help-form-card {
    border: 1px solid #E5E5E5;
    border-top: 3px solid #FED402;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 32px;
}

/* Form wrapper */
.help-form {
    display: block;
}

/* Honeypot — visually hidden */
.help-form-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Error banner inside card */
.help-form-error {
    padding: 12px 16px;
    margin-bottom: 20px;
    background: rgba(160, 0, 0, 0.06);
    border: 1px solid rgba(160, 0, 0, 0.15);
    border-left: 4px solid #A00000;
    border-radius: 0;
    color: #A00000;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ---- Field-Level Error Messages ---- */

.help-form-field-error {
    display: none;
    margin-top: 4px;
    color: #A00000;
    font-size: 0.75rem;
    line-height: 1.3;
    font-weight: 500;
}

.help-form-field-error::before {
    content: '⚠ ';
    margin-right: 2px;
}

/* Error field styling */
.help-form-field input.error,
.help-form-field textarea.error {
    border-color: #A00000;
    border-left: 4px solid #A00000;
    background-color: rgba(160, 0, 0, 0.02);
}

/* Focus on error field */
.help-form-field input.error:focus,
.help-form-field textarea.error:focus {
    border-color: #0268BB;
    border-left-color: #A00000;  /* Keep red left border */
    box-shadow: inset 0 0 0 1px #0268BB;
    outline: none;
}

/* ---- Modern Single-Column Form Layout ---- */

/* Field wrapper (replaces old help-form-row) */
.help-form-field {
    display: block;
    margin-bottom: 24px;
}

/* Textarea variant */
.help-form-field--textarea {
    margin-bottom: 28px;
}

/* Labels - now semantic and above fields */
.help-form-field label,
.help-form-fieldset-legend {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #002B58;
    line-height: 1.4;
}

.help-form-field label {
    font-size: 0.875rem;
    font-weight: 600;
}

.help-required {
    color: #A00000;
    margin-left: 2px;
}

/* Fieldset for grouped fields (name) */
.help-form-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.help-form-fieldset-legend {
    padding: 0;
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #002B58;
}

/* Field pair (for first/last name) */
.help-form-field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.help-form-field-pair .help-form-field {
    margin-bottom: 0;
}

/* Inputs and textareas */
.help-form-field input,
.help-form-field textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #D0D0D0;
    border-radius: 0;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
    min-height: 44px;
}

.help-form-field input:focus,
.help-form-field textarea:focus {
    border-color: #0268BB;
    box-shadow: inset 0 0 0 1px #0268BB;
    outline: none;
}

.help-form-field textarea {
    resize: vertical;
    min-height: 130px;
    max-height: 400px;
    line-height: 1.6;
    padding: 10px 12px;
}

.help-form-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #4A4A4A;  /* ~7.5:1 contrast — PASSES AAA */
    line-height: 1.3;
}

/* Error state on inputs */
.help-form-field input.error,
.help-form-row-fields textarea.error {
    border-color: #A00000;
}

/* ---- Submit Footer ---- */

.help-form-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 32px;
}

.help-form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: #002B58;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    min-height: 44px;
}

.help-form-submit:hover:not(:disabled) {
    background: #001a3a;
    transform: translateY(-1px);
}

.help-form-submit:focus-visible {
    outline: 2px solid #002B58;
}

.help-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.help-form-submit i {
    font-size: 1rem;
    margin-top: -2px;
}

.help-form-footer-note {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
    margin: 8px 0 0 0;
    padding: 0;
}

.help-form-footer-note i {
    font-size: 0.75rem;
    margin-top: -2px;
    flex-shrink: 0;
}

/* ---- Help Success Modal ---- */

.help-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.help-success-modal.show {
    opacity: 1;
    visibility: visible;
}

.help-success-content {
    background: white;
    padding: 2.5rem 2rem 2rem;
    max-width: 440px;
    width: 90%;
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.success-icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0268BB 0%, #002B58 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-icon-circle i {
    font-size: 3rem;
    color: white;
    animation: checkmark 0.6s ease 0.4s backwards;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.help-success-content h3 {
    font-family: 'Minion Pro', Georgia, serif;
    font-size: 1.75rem;
    color: #002B58;
    margin: 0 0 1rem 0;
    font-weight: normal;
}

.help-success-content p {
    color: #555;
    margin: 0 0 2rem 0;
    line-height: 1.6;
    font-size: 1rem;
}

.success-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: #002B58;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.success-close-btn:hover {
    background: #001a3a;
}

.success-close-btn:focus-visible {
    outline: 2px solid #002B58;
}

/* ---- Sidebar ---- */

.help-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.help-sidebar-card {
    background: #fff;
    border: 1px solid #E5E5E5;
    border-bottom: none;
    padding: 18px 20px;
}

.help-sidebar-card:last-child {
    border-bottom: 1px solid #E5E5E5;
}

.help-sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #002B58;
    margin: 0 0 10px 0;
}

.help-sidebar-title i {
    font-size: 1rem;
    opacity: 0.5;
    margin-top: -2px;
}

.help-sidebar-card p {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.help-sidebar-card p strong {
    color: #002B58;
}

.help-sidebar-tips {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.help-sidebar-tips li {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 4px;
}

.help-sidebar-tips li:last-child {
    margin-bottom: 0;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .help-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .help-sidebar {
        order: -1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .help-sidebar-card {
        flex: 1;
        min-width: 200px;
        border-bottom: 1px solid #E5E5E5;
    }
}

@media (max-width: 768px) {
    .help-container {
        padding: 20px 20px 48px;
    }

    /* Mobile-optimized form layout */
    .help-form-field {
        margin-bottom: 20px;
    }

    .help-form-field--textarea {
        margin-bottom: 24px;
    }

    /* Stack name fields vertically on mobile */
    .help-form-field-pair {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Increase input size for mobile touch targets */
    .help-form-field input,
    .help-form-field textarea {
        padding: 12px 14px;
        min-height: 44px;
        font-size: 1rem;  /* Prevent iOS zoom on input focus */
    }

    .help-form-fieldset-legend {
        font-size: 0.875rem;
    }

    .help-form-footer {
        margin-top: 28px;
        gap: 12px;
    }

    .help-form-submit {
        width: 100%;
        padding: 14px 20px;
    }

    .help-sidebar {
        flex-direction: column;
    }

    .help-sidebar-card {
        min-width: 0;
    }
}

/* Accessibility - Focus-visible Styles */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
    background-color: #E8F4FF;
    padding-left: 15px;
}
