/**
 * Email-Gated Discount Tab — front-end styles.
 * Accent colour comes from the inline --egd-accent variable on .egd-tab.
 */
.egd-tab {
    --egd-accent: #660032;
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    align-items: center;
    font-family: inherit;
}

.egd-handle {
    background: var(--egd-accent);
    color: #fff;
    border: 0;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 150px;
    border-radius: 10px 0 0 10px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s ease;
}

.egd-handle:hover {
    filter: brightness(0.88);
}

.egd-handle-text {
    display: block;
    transform: rotate(180deg);
    writing-mode: vertical-rl;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    white-space: nowrap;
}

.egd-panel[hidden] {
    display: none;
}

.egd-panel {
    position: absolute;
    right: 46px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    width: 290px;
    background: #fff;
    border: 1px solid #e5e0dd;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(26, 10, 16, 0.18);
    padding: 20px 18px 18px;
    color: #1a0a10;
}

.egd-tab.is-open .egd-panel {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.egd-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

.egd-close:hover {
    color: #1a0a10;
}

.egd-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.egd-title.egd-success {
    color: #1c7c3f;
}

.egd-sub {
    margin: 0 0 12px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.egd-form {
    margin: 0;
}

.egd-email {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    /* 16px avoids iOS zoom-on-focus */
    font-size: 16px;
    border: 1px solid #d8cdc9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.egd-email:focus {
    outline: none;
    border-color: var(--egd-accent);
    box-shadow: 0 0 0 3px rgba(102, 0, 50, 0.12);
}

.egd-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.45;
    margin-bottom: 12px;
}

.egd-consent input {
    margin-top: 2px;
    flex: 0 0 auto;
}

.egd-consent a {
    color: var(--egd-accent);
}

.egd-submit {
    width: 100%;
    background: var(--egd-accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.egd-submit:hover {
    filter: brightness(0.9);
}

.egd-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.egd-error {
    margin: 10px 0 0;
    font-size: 12px;
    color: #b32d2e;
    line-height: 1.4;
}

.egd-error[hidden] {
    display: none;
}

.egd-code-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.egd-code {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: #f8f4f2;
    border: 1px dashed #b9a3ad;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--egd-accent);
}

.egd-copy {
    flex: 0 0 auto;
    background: var(--egd-accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.egd-copy:hover {
    filter: brightness(0.9);
}

.egd-copy.is-copied {
    background: #1c7c3f;
}

.egd-state[hidden] {
    display: none;
}

.egd-terms {
    margin: 12px 0 0;
    font-size: 11px;
    color: #999;
    line-height: 1.5;
}

@media (max-width: 576px) {
    .egd-handle {
        width: 32px;
        height: 120px;
    }

    .egd-handle-text {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .egd-panel {
        width: calc(100vw - 70px);
        max-width: 290px;
        right: 38px;
    }
}
