/**
 * Gate2Enter Product Addons – Frontend CSS
 * Modal form, inline price fields, drag-drop upload, error states
 * Brand: navy #1A1F3D, orange #F07623, blue #5B8BFF
 */

/* ── Modal overlay ────────────────────── */
.g2e-pa-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.g2e-pa-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 31, 61, .55);
    backdrop-filter: blur(2px);
}
.g2e-pa-modal__container {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(26, 31, 61, .3);
    display: flex;
    flex-direction: column;
    animation: g2eModalIn .25s ease;
}
@keyframes g2eModalIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal header ─────────────────────── */
.g2e-pa-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
    border-radius: 12px 12px 0 0;
}
.g2e-pa-modal__header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1A1F3D;
}
.g2e-pa-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9CA3B8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color .15s;
}
.g2e-pa-modal__close:hover {
    color: #d63638;
}

/* ── Modal body ───────────────────────── */
.g2e-pa-modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.g2e-pa-modal__body::-webkit-scrollbar {
    width: 5px;
}
.g2e-pa-modal__body::-webkit-scrollbar-thumb {
    background: #d0d3d9;
    border-radius: 3px;
}

/* ── Modal footer ─────────────────────── */
.g2e-pa-modal__footer {
    padding: 14px 24px;
    border-top: 1px solid #eee;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.g2e-pa-modal__buttons {
    display: flex;
    gap: 10px;
}
.g2e-pa-modal__btn {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.g2e-pa-modal__btn--cancel {
    background: #f0f2f5;
    color: #666;
}
.g2e-pa-modal__btn--cancel:hover {
    background: #e5e7ec;
}
.g2e-pa-modal__btn--submit {
    background: #F07623;
    color: #fff;
}
.g2e-pa-modal__btn--submit:hover {
    background: #d8651b;
}
.g2e-pa-modal__btn--submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ── Form fields ──────────────────────── */
.g2e-pa-form-field {
    margin-bottom: 18px;
}
.g2e-pa-form-field:last-child {
    margin-bottom: 0;
}
.g2e-pa-form-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #1A1F3D;
}
.g2e-pa-req {
    color: #d63638;
    font-weight: 700;
}
.g2e-pa-form-field .g2e-pa-help {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #888;
}
.g2e-pa-form-field .g2e-pa-help-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 3px;
    font-size: 12px;
    color: #5B8BFF;
    text-decoration: none;
}
.g2e-pa-form-field .g2e-pa-help-link:hover {
    text-decoration: underline;
}

/* Text inputs */
.g2e-pa-input,
.g2e-pa-textarea,
.g2e-pa-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d3d9;
    border-radius: 6px;
    font-size: 14px;
    color: #1A1F3D;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.g2e-pa-input:focus,
.g2e-pa-textarea:focus,
.g2e-pa-select:focus {
    border-color: #5B8BFF;
    box-shadow: 0 0 0 3px rgba(91, 139, 255, .12);
    outline: none;
}
.g2e-pa-textarea {
    resize: vertical;
    min-height: 80px;
}
.g2e-pa-input.g2e-pa-input--error,
.g2e-pa-textarea.g2e-pa-input--error,
.g2e-pa-select.g2e-pa-input--error {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214, 54, 56, .1);
}

/* Tooltip icon for help_display=tooltip */
.g2e-pa-tooltip-wrap {
    position: relative;
    display: inline-block;
    margin-left: 4px;
}
.g2e-pa-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e4e9;
    font-size: 10px;
    font-weight: 700;
    color: #666;
    cursor: help;
    line-height: 1;
}
.g2e-pa-tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1A1F3D;
    color: #fff;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.g2e-pa-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1A1F3D;
}
.g2e-pa-tooltip-wrap:hover .g2e-pa-tooltip-text {
    display: block;
}

/* ── Error messages ───────────────────── */
.g2e-pa-error-msg {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #d63638;
    font-weight: 500;
    animation: g2eShake .3s ease;
}
@keyframes g2eShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* ── Checkbox / radio groups ──────────── */
.g2e-pa-choice-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.g2e-pa-choice-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}
.g2e-pa-choice-item input[type="checkbox"],
.g2e-pa-choice-item input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #F07623;
}
.g2e-pa-choice-item__price {
    margin-left: auto;
    font-size: 12px;
    color: #F07623;
    font-weight: 600;
}
/* "Other" free text input */
.g2e-pa-choice-other-input {
    margin-left: 26px;
    margin-top: 4px;
    padding: 6px 10px;
    border: 1px solid #d0d3d9;
    border-radius: 5px;
    font-size: 13px;
    width: calc(100% - 26px);
}

/* ── File upload / drag-drop ──────────── */
.g2e-pa-dropzone {
    border: 2px dashed #d0d3d9;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: #fafbfc;
}
.g2e-pa-dropzone:hover,
.g2e-pa-dropzone.g2e-pa-dropzone--active {
    border-color: #F07623;
    background: rgba(240, 118, 35, .04);
}
.g2e-pa-dropzone__icon {
    font-size: 32px;
    color: #c0c4cc;
    margin-bottom: 8px;
}
.g2e-pa-dropzone__text {
    font-size: 13px;
    color: #888;
}
.g2e-pa-dropzone__text strong {
    color: #5B8BFF;
}
.g2e-pa-file-list {
    margin-top: 8px;
}
.g2e-pa-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f5f6f8;
    border-radius: 5px;
    margin-bottom: 4px;
    font-size: 12px;
}
.g2e-pa-file-item__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.g2e-pa-file-item__remove {
    background: none;
    border: none;
    color: #c0c4cc;
    cursor: pointer;
    font-size: 14px;
}
.g2e-pa-file-item__remove:hover {
    color: #d63638;
}
.g2e-pa-file-uploading {
    font-size: 12px;
    color: #5B8BFF;
    padding: 4px 0;
}

/* ── Repeatable fields ────────────────── */
.g2e-pa-repeat-group {
    border: 1px solid #e8eaef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}
.g2e-pa-repeat-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.g2e-pa-repeat-item:last-child {
    margin-bottom: 0;
}
.g2e-pa-repeat-item .g2e-pa-input {
    flex: 1;
}
.g2e-pa-repeat-remove {
    background: none;
    border: none;
    color: #c0c4cc;
    cursor: pointer;
    font-size: 18px;
    padding: 8px 4px;
    line-height: 1;
}
.g2e-pa-repeat-remove:hover {
    color: #d63638;
}
.g2e-pa-repeat-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f5f6f8;
    border: 1px solid #d0d3d9;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #5B8BFF;
    font-weight: 600;
    transition: all .15s;
    margin-top: 4px;
}
.g2e-pa-repeat-add:hover {
    background: #eef1f5;
    border-color: #5B8BFF;
}

/* ── Heading / separator fields ───────── */
.g2e-pa-heading {
    font-size: 16px;
    font-weight: 700;
    color: #1A1F3D;
    padding: 8px 0 4px;
    border-bottom: 2px solid #F07623;
    margin-bottom: 4px;
}
.g2e-pa-separator {
    border: none;
    border-top: 1px solid #e8eaef;
    margin: 12px 0;
}

/* ── Modal description text ───────────── */
.g2e-pa-modal__desc {
    margin: 0 0 18px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ── Inline pricing-box fields ────────── */
.g2e-pa-pricing-box {
    margin: 16px 0;
    padding: 16px;
    background: #fafbfc;
    border: 1px solid #e2e4e9;
    border-radius: 8px;
}
.g2e-pa-pricing-box label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1A1F3D;
    margin-bottom: 8px;
}
.g2e-pa-pricing-box__input-wrap {
    display: flex;
    align-items: center;
    max-width: 220px;
    border: 2px solid #F07623;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .15s;
}
.g2e-pa-pricing-box__input-wrap:focus-within {
    box-shadow: 0 0 0 3px rgba(240, 118, 35, .15);
}
.g2e-pa-pricing-box__currency {
    padding: 10px 12px;
    background: #F07623;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}
.g2e-pa-pricing-box__input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 600;
    color: #1A1F3D;
    outline: none;
    background: transparent;
    -moz-appearance: textfield;
}
.g2e-pa-pricing-box__input::-webkit-inner-spin-button,
.g2e-pa-pricing-box__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.g2e-pa-pricing-box__input::placeholder {
    color: #c0c4cc;
    font-weight: 400;
}
.g2e-pa-pricing-box .g2e-pa-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}
.g2e-pa-pricing-box__range {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #9CA3B8;
    font-weight: 500;
}
.g2e-pa-pricing-box__input.g2e-pa-input--error {
    box-shadow: 0 0 0 2px rgba(214, 54, 56, .25);
}
.g2e-pa-pricing-box__error {
    margin-top: 6px;
}

/* ── USD equivalent display — removed (no longer shown in modal) ── */

/* ── Product-as-addon field ───────────── */
.g2e-pa-product-addon {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.g2e-pa-product-addon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafbfc;
    border: 1px solid #e2e4e9;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.g2e-pa-product-addon-item:hover,
.g2e-pa-product-addon-item.g2e-pa-product-addon-item--selected {
    border-color: #F07623;
    background: rgba(240, 118, 35, .04);
}
.g2e-pa-product-addon-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}
.g2e-pa-product-addon-item__name {
    font-size: 13px;
    font-weight: 500;
}
.g2e-pa-product-addon-item__price {
    font-size: 12px;
    color: #F07623;
    font-weight: 600;
}

/* ── Color / date / time inputs ───────── */
.g2e-pa-input[type="color"] {
    width: 50px;
    height: 36px;
    padding: 2px;
    border: 1px solid #d0d3d9;
    border-radius: 6px;
    cursor: pointer;
}
.g2e-pa-input[type="date"],
.g2e-pa-input[type="time"],
.g2e-pa-input[type="datetime-local"] {
    max-width: 220px;
}

/* ── Responsive ───────────────────────── */
@media (max-width: 600px) {
    .g2e-pa-modal {
        padding: 10px;
    }
    .g2e-pa-modal__container {
        max-height: 95vh;
        border-radius: 10px;
    }
    .g2e-pa-modal__header {
        padding: 14px 16px;
    }
    .g2e-pa-modal__body {
        padding: 16px;
    }
    .g2e-pa-modal__footer {
        padding: 12px 16px;
        justify-content: stretch;
    }
    .g2e-pa-modal__buttons {
        width: 100%;
    }
    .g2e-pa-modal__btn {
        flex: 1;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════
 * v1.2.0 additions
 * ═══════════════════════════════════════════ */

/* Security / retention notice at the top of the modal */
.g2e-pa-modal__notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: -6px 0 18px;
    padding: 10px 12px;
    background: rgba(91, 139, 255, .08);
    border: 1px solid rgba(91, 139, 255, .25);
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #1A1F3D;
}
.g2e-pa-modal__notice-icon {
    flex: none;
    line-height: 1.3;
}

/* Password field: visible text + Hide/Show toggle */
.g2e-pa-secret {
    position: relative;
    display: flex;
    align-items: stretch;
}
.g2e-pa-secret .g2e-pa-secret__input {
    padding-right: 64px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .02em;
}
.g2e-pa-secret__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    padding: 4px 10px;
    border: 1px solid #d0d3d9;
    border-radius: 5px;
    background: #fafbfc;
    color: #5B8BFF;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
}
.g2e-pa-secret__toggle:hover {
    border-color: #5B8BFF;
}
.g2e-pa-secret .g2e-pa-input--error + .g2e-pa-secret__toggle {
    border-color: #d63638;
}

/* Inputs are now type="text" for email/url – keep consistent sizing */
.g2e-pa-modal .g2e-pa-input,
.g2e-pa-modal .g2e-pa-textarea,
.g2e-pa-modal .g2e-pa-select {
    box-sizing: border-box;
    max-width: 100%;
}
