/**
 * EG Popup Form - Frontend Styles
 * @author Emir Gül
 */

/* Google Fonts - Urbanist */
@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;700&display=swap');

/* Overlay */
.eg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: egPopupFadeIn 0.3s ease;
}

@keyframes egPopupFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Container */
.eg-popup-container {
    position: relative;
    width: 100%;
    max-width: 724px;
    min-height: 257px;
    background: linear-gradient(135deg, rgba(40, 60, 80, 0.95) 0%, rgba(30, 45, 60, 0.98) 100%);
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: egPopupSlideIn 0.4s ease;
}

@keyframes egPopupSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.eg-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0 !important;
}

.eg-popup-close svg {
    width: 20px;
    height: 20px;
    stroke: #fff !important;
}

/* Content */
.eg-popup-content {
    padding: 50px 45px;
    background: linear-gradient(135deg, rgba(30, 60, 80, 0.85) 0%, rgba(20, 40, 55, 0.9) 100%);
}

/* Header */
.eg-popup-header {
    margin-bottom: 30px;
}

.eg-popup-title {
    font-family: 'Urbanist', sans-serif;
    font-size: 46px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 60px;
    letter-spacing: -1px;
}

.eg-popup-subtitle {
    font-family: 'Urbanist', sans-serif;
    font-size: 46px;
    font-weight: 400;
    color: #ffffff;
    margin: 0;
    line-height: 60px;
    letter-spacing: -1px;
}

/* Form */
.eg-popup-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eg-popup-form-field {
    width: 100%;
    max-width: 536px;
}

/* Input Styles - Figma Specs: 536x48px, 5px radius, 1px white border */
.eg-popup-form input[type="text"],
.eg-popup-form input[type="email"],
.eg-popup-form input[type="tel"],
.eg-popup-form textarea,
.eg-popup-form select {
    width: 100%;
    max-width: 536px;
    height: 48px;
    padding: 0 18px;
    font-family: 'Urbanist', sans-serif;
    font-size: 15px;
    color: #333;
    background: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.eg-popup-form input[type="text"]:focus,
.eg-popup-form input[type="email"]:focus,
.eg-popup-form input[type="tel"]:focus,
.eg-popup-form textarea:focus,
.eg-popup-form select:focus {
    border-color: #15A7E0;
    box-shadow: 0 0 0 3px rgba(21, 167, 224, 0.2);
}

.eg-popup-form input::placeholder,
.eg-popup-form textarea::placeholder {
    color: #888;
    font-family: 'Urbanist', sans-serif;
}

.eg-popup-form textarea {
    min-height: 80px;
    height: auto;
    padding: 14px 18px;
    resize: vertical;
}

.eg-popup-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-color: #FFFFFF;
    padding-right: 40px;
}

/* Privacy Checkbox */
.eg-popup-privacy-field {
    margin-top: 8px;
    max-width: 536px;
}

.eg-popup-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 10px;
}

.eg-popup-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.eg-popup-checkmark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.eg-popup-checkbox input[type="checkbox"]:checked+.eg-popup-checkmark {
    background: #15A7E0;
    border-color: #15A7E0;
}

.eg-popup-checkbox input[type="checkbox"]:checked+.eg-popup-checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.eg-popup-privacy-text {
    font-family: 'Urbanist', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.eg-popup-privacy-text a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.eg-popup-privacy-text a:hover {
    color: #fff;
}

/* Submit Button - Figma Specs: 146.55x39px, 35px radius, #15A7E0, 2px border */
.eg-popup-submit-field {
    margin-top: 10px;
}

.eg-popup-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 146px;
    height: 39px;
    padding: 0 30px;
    font-family: 'Urbanist', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff !important;
    background: #15A7E0 !important;
    border: 2px solid #15A7E0 !important;
    border-radius: 35px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none !important;
}

.eg-popup-submit-btn:hover {
    background: #1291c5 !important;
    border-color: #1291c5 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(21, 167, 224, 0.4) !important;
}

.eg-popup-submit-btn:active {
    transform: translateY(0);
}

.eg-popup-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Message */
.eg-popup-message {
    padding: 12px 18px;
    border-radius: 5px;
    font-family: 'Urbanist', sans-serif;
    font-size: 14px;
    text-align: center;
    max-width: 536px;
}

.eg-popup-message.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.eg-popup-message.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Loading State */
.eg-popup-form.loading .eg-popup-submit-btn {
    pointer-events: none;
    opacity: 0.7;
}

.eg-popup-form.loading .eg-popup-submit-btn::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: egPopupSpin 0.8s linear infinite;
}

@keyframes egPopupSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .eg-popup-overlay {
        padding: 15px;
    }

    .eg-popup-content {
        padding: 40px 25px;
    }

    .eg-popup-title {
        font-size: 28px;
        line-height: 36px;
    }

    .eg-popup-subtitle {
        font-size: 28px;
        line-height: 36px;
    }

    .eg-popup-form-field {
        max-width: 100%;
    }

    .eg-popup-form input[type="text"],
    .eg-popup-form input[type="email"],
    .eg-popup-form input[type="tel"],
    .eg-popup-form textarea,
    .eg-popup-form select {
        max-width: 100%;
        height: 44px;
        font-size: 14px;
    }

    .eg-popup-privacy-field {
        max-width: 100%;
    }

    .eg-popup-submit-btn {
        width: 100%;
    }

    .eg-popup-message {
        max-width: 100%;
    }
}