@import url('styles.css');
/* ── Report Issue / Feedback — DS-aligned (MSWE-069)
 * Shell matches subscribe modal / #ds-panel-page: panel-card, sky header,
 * hop-item data card, scrollable panel-body, footer band, file upload.
 * ──────────────────────────────────────────────────────────────────────────── */

/* ── Overlay backdrop ────────────────────────────────────────────────────── */
.feedback-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(44, 76, 107, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: safe center;
    justify-content: safe center;
    padding: 1.5rem;
    overflow: auto;
}

/* Keep mounted during CRT power-off; open/close timing lives in styles.css + feedback_ui.js */
.feedback-modal.feedback-modal--visible,
.feedback-modal.closing {
    display: flex;
}

/* Feedback is the horizontal scroller once the panel hits 340px. Hide the landing bar so the two do not stack. */
html:has(#feedback-modal.feedback-modal--visible),
body:has(#feedback-modal.feedback-modal--visible) {
    overflow-x: hidden !important;
}

#feedback-modal {
    --checkout-label-size: 15px;
    --checkout-label-weight: 500;
    --checkout-label-tracking: 0.02em;
}

#feedback-modal .feedback-modal__panel {
    position: relative;
    width: min(100%, var(--overlay-width-form-panel));
    min-width: var(--overlay-min-stable);
    flex-shrink: 0;
    max-width: 100%;
    max-height: 90vh;
    min-height: min(420px, calc(90vh - 3rem));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

/* Header — sky strip + centered title grid (MSWE-106 parity) */
#feedback-modal .feedback-modal__header.panel-header.panel-header--sky {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 8px;
    padding: 16px 20px;
    background: var(--color-vintage-sky);
    color: var(--color-milk-white);
    position: relative;
    border-bottom: 1px solid rgba(217, 182, 17, 0.3) !important;
}

@keyframes feedback-line-rollout {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

#feedback-modal .feedback-modal__header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent-secondary);
    transform: scaleX(0);
    transform-origin: center;
    box-shadow: 0 0 3px var(--color-accent-secondary), 0 0 10px rgba(217, 182, 17, 0.5);
    will-change: transform;
}

#feedback-modal.feedback-modal--visible .feedback-modal__header::after {
    animation: feedback-line-rollout 1.5s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

#feedback-modal.feedback-modal--visible .feedback-modal__close-btn {
    animation: close-btn-rollout 1.0s cubic-bezier(0.34, 1.56, 0.64, 1) 1s backwards;
}

#feedback-modal .feedback-modal__title {
    grid-column: 2;
    justify-self: center;
    margin: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-milk-white);
}

#feedback-modal .feedback-modal__header .feedback-modal__close-btn {
    grid-column: 3;
    justify-self: end;
}

/* Body */
#feedback-modal .feedback-modal__section.panel-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--color-text-main);
    background-color: var(--color-milk-white);
}

#feedback-modal .feedback-modal__intro {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

/* DS §14 data card — form fields */
#feedback-modal .feedback-modal__form-card.hop-item.card.card--hop {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 12px;
    background: var(--color-wimbledon-white);
    border: 1.5px solid var(--color-sandsel-beige);
    border-radius: 6px;
    box-shadow: none;
    transition: all 0.2s ease;
}

#feedback-modal .feedback-modal__form-card.hop-item.card.card--hop:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(44, 76, 107, 0.2);
}

#feedback-modal .feedback-modal__form-card .feedback-modal__form-header.hop-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--data-card-header-separator);
    color: var(--color-academy-blue);
}

#feedback-modal .feedback-modal__form-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-transform: uppercase;
    color: inherit;
}

#feedback-modal .feedback-modal__form-details.hop-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

#feedback-modal .feedback-modal__field.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

#feedback-modal .checkout-field-label {
    font-family: var(--font-heading);
    font-size: var(--checkout-label-size);
    font-weight: var(--checkout-label-weight);
    letter-spacing: var(--checkout-label-tracking);
    text-transform: none;
    color: var(--color-academy-blue);
    display: block;
    margin-bottom: 0;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

#feedback-modal .checkout-field-input,
#feedback-modal input.checkout-field-input,
#feedback-modal textarea.checkout-field-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 10px 14px;
    font-size: 0.95rem;
    line-height: 1.2;
    background: var(--color-milk-white);
    border: 2px solid var(--color-caribbean-turquoise);
    border-radius: var(--radius-sm);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#feedback-modal textarea.checkout-field-input {
    min-height: 120px;
    resize: vertical;
    line-height: 1.45;
}

#feedback-modal .checkout-field-input:focus {
    border-color: var(--color-goldenrod-yellow);
    box-shadow: 0 0 0 3px rgba(217, 182, 17, 0.2);
}

#feedback-modal .checkout-field-input:hover:not(:disabled):not(:focus) {
    border-color: var(--color-accent-secondary);
    box-shadow: 0 0 0 2px rgba(217, 182, 17, 0.12);
}

#feedback-modal .checkout-field-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-bg);
}

/* File upload — DS #ds-file-upload (compact Action Primary) */
#feedback-modal .feedback-modal__file-upload.checkout-file-upload {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    vertical-align: top;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
    align-self: flex-start;
}

#feedback-modal .feedback-modal__file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    font-size: 16px;
}

#feedback-modal .feedback-modal__file-upload-face.checkout-file-upload-face {
    position: relative;
    z-index: 1;
    pointer-events: none;
    background-color: var(--color-academy-blue);
    color: var(--color-milk-white);
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    user-select: none;
}

#feedback-modal .feedback-modal__file-upload:hover .feedback-modal__file-upload-face {
    background-color: var(--color-caribbean-turquoise);
    border-color: var(--color-accent-secondary);
    box-shadow: var(--shadow-classic);
    transform: translateY(-2px);
}

#feedback-modal .feedback-modal__file-upload:active .feedback-modal__file-upload-face {
    transform: scale(0.96);
    box-shadow: none;
}

#feedback-modal .feedback-modal__attachments-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

#feedback-modal .feedback-modal__attachments-list li {
    margin: 0;
    padding: 6px 10px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--color-text-main);
    background: rgba(102, 191, 191, 0.08);
    border: 1px solid var(--color-sandsel-beige);
    border-radius: var(--radius-sm);
}

.feedback-modal__error {
    padding: 12px 18px;
    background: rgba(197, 59, 50, 0.08);
    border: 1.5px solid rgba(197, 59, 50, 0.3);
    border-radius: 10px;
    color: var(--color-rangoon-red);
    font-size: 0.88rem;
    font-weight: 600;
}

/* Footer band */
#feedback-modal .feedback-modal__footer {
    flex-shrink: 0;
    margin-top: 0;
    padding: 10px 16px;
    position: relative;
    background: rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

#feedback-modal .feedback-modal__footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-border);
    transform: scaleX(0);
    transform-origin: center;
    will-change: transform;
}

#feedback-modal.feedback-modal--visible .feedback-modal__footer::before {
    animation: feedback-line-rollout 1.5s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

#feedback-modal .feedback-modal__actions.panel-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

#feedback-modal #feedback-submit-btn.ditzler-btn-submit {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
    border-radius: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 240px;
    transition: all 0.2s ease;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

#feedback-modal button.ditzler-btn-submit:disabled {
    opacity: 1 !important;
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(44, 76, 107, 0.32);
    color: rgba(250, 248, 242, 0.9);
    border-color: rgba(250, 248, 242, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success acknowledgement — overlay host (inner card tokens in styles.css, parity #sub-success) */
#feedback-modal #feedback-success.feedback-modal__success-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: feedbackFadeIn 0.35s ease;
}

@keyframes feedbackFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#feedback-modal button.ditzler-btn-modal-primary:disabled {
    opacity: 1 !important;
    background: rgba(44, 76, 107, 0.32);
    color: rgba(250, 248, 242, 0.9);
    border-color: rgba(250, 248, 242, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.feedback-modal--hidden {
    display: none !important;
}

.feedback-modal--locked {
    opacity: 0.55;
    pointer-events: none;
}

/* Site Menu Content embeds the overlay in the default shell (MSWE-199). */
.site-menu-content__page #feedback-modal.feedback-menu-admin {
    position: relative;
    inset: auto;
    z-index: auto;
    display: flex;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: stretch;
    justify-content: stretch;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: 100%;
    min-height: 0;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-modal__close-btn {
    pointer-events: none;
    opacity: 0.55;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-menu-admin__note-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-menu-admin__note-stack:not(:empty) {
    margin-bottom: 12px;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-menu-admin__note-card {
    margin: 0;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-menu-admin__file-face {
    pointer-events: auto;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-menu-admin__file-face .feedback-modal__file-upload-face {
    pointer-events: auto;
    user-select: text;
}

.site-menu-content__page #feedback-modal.feedback-menu-admin .feedback-menu-admin__placeholder-edit {
    display: block;
    margin-top: 6px;
}

