/**
 * Elementor Discount Code Generator — Frontend Styles
 *
 * Styles for the discount code form widget.
 */

/* ── Form container ────────────────────────────────────────────── */

.edcg-widget {
    width: 100%;
}

.edcg-form {
    width: 100%;
    box-sizing: border-box;
}

/* ── Form fields ───────────────────────────────────────────────── */

.edcg-field {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.edcg-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.edcg-required {
    color: #e74c3c;
    margin-left: 2px;
}

.edcg-field input[type="text"],
.edcg-field input[type="email"],
.edcg-field input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.edcg-field input[type="text"]:focus,
.edcg-field input[type="email"]:focus,
.edcg-field input[type="tel"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.edcg-field input::placeholder {
    color: #999;
}

/* ── Honeypot field (hidden) ───────────────────────────────────── */

.edcg-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* ── Submit button ─────────────────────────────────────────────── */

.edcg-field-submit {
    margin-top: 20px;
}

.edcg-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1;
}

.edcg-submit:hover {
    background: #2980b9;
}

.edcg-submit:active {
    transform: scale(0.98);
}

.edcg-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Error message ─────────────────────────────────────────────── */

.edcg-error-message {
    margin-top: 15px;
    padding: 12px 16px;
    background: #fdf0f0;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    color: #c0392b;
    font-size: 14px;
}

/* ── Success display ───────────────────────────────────────────── */

.edcg-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    animation: edcgFadeIn 0.4s ease-out;
}

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

.edcg-success-message {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    margin: 0 0 20px;
}

/* ── Coupon display box ───────────────────────────────────────── */

.edcg-coupon-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f0f7ff;
    border-style: dashed;
    border-width: 2px;
    border-color: #3498db;
    border-radius: 8px;
    padding: 12px 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.edcg-coupon-code {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #2c3e50;
    font-family: 'Courier New', Courier, monospace;
    user-select: all;
}

/* ── Copy button ──────────────────────────────────────────────── */

.edcg-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
}

.edcg-copy-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
    color: #333;
}

.edcg-copy-btn:active {
    transform: scale(0.96);
}

.edcg-copy-btn.edcg-copied {
    background-color: #d1fae5;
    border-color: #27ae60;
    color: #065f46;
}

.edcg-copy-btn .edcg-copy-icon {
    flex-shrink: 0;
}

.edcg-copy-btn .edcg-copy-text {
    white-space: nowrap;
}

/* Hide text by default if icon-only mode */
.edcg-copy-btn.edcg-copy-icon-only .edcg-copy-text {
    display: none;
}

/* Check icon shown when copied */
.edcg-copy-btn .edcg-check-icon {
    color: #065f46;
}

/* ── Call Now button ──────────────────────────────────────────── */

.edcg-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 10px;
    margin-top: 20px;
    padding: 16px 32px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1;
}

.edcg-call-btn:hover {
    background: #219a52;
    color: #fff;
    text-decoration: none;
}

.edcg-call-btn:active {
    transform: scale(0.98);
}

.edcg-call-icon {
    flex-shrink: 0;
}

.edcg-call-text {
    white-space: nowrap;
}

/* Call button alignment classes */
.edcg-call-btn.edcg-align-left {
    align-self: flex-start;
}

.edcg-call-btn.edcg-align-center {
    align-self: center;
}

.edcg-call-btn.edcg-align-right {
    align-self: flex-end;
}

.edcg-call-btn.edcg-align-stretch {
    align-self: stretch;
    width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 480px) {
    .edcg-coupon-display {
        flex-direction: row;
        gap: 8px;
        padding: 12px 16px;
    }

    .edcg-coupon-code {
        font-size: 18px;
    }

    .edcg-submit {
        width: 100%;
    }

    .edcg-call-btn {
        width: 100%;
        padding: 16px 20px;
    }

    .edcg-call-btn.edcg-align-left,
    .edcg-call-btn.edcg-align-right,
    .edcg-call-btn.edcg-align-center {
        align-self: stretch;
        width: 100%;
    }
}
