/**
 * Etsy Sign In / Register / Lost Password Modal Styling
 */

/* Modal Container (Magnific Popup wrapper override) */
.etsy-signin-modal-wrap.lightbox-content {
    background: transparent !important;
    padding: 0 !important;
    max-width: 440px !important;
    margin: 30px auto !important;
    position: relative;
    box-shadow: none !important;
}

/* Make sure Flatsome's default padding/borders are cleaned */
.mfp-content .etsy-signin-modal-wrap {
    text-align: left;
}

/* Inner Box Card */
.etsy-signin-box {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 34px 32px 28px 32px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #222222;
    box-sizing: border-box;
    overflow: hidden;
}

.etsy-signin-box * {
    box-sizing: border-box;
}

/* Close button on modal */
.mfp-wrap .mfp-close,
.etsy-signin-modal-wrap .mfp-close {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    right: 18px;
    top: 18px;
    font-size: 24px;
    font-weight: 300;
    color: #222222;
    background-color: transparent;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.mfp-wrap .mfp-close:hover,
.etsy-signin-modal-wrap .mfp-close:hover {
    background-color: #f0f0f0;
    color: #000000;
    opacity: 1;
}

/* Modal Header: Title on Left, Action Pill Button on Right */
.etsy-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 16px;
}

.etsy-modal-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #222222;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

/* Header Switch Button (e.g. Register / Sign in) */
.etsy-modal-switch-btn {
    background-color: transparent;
    border: 1.5px solid #222222;
    border-radius: 9999px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.25;
}

.etsy-modal-switch-btn:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
}

.etsy-modal-desc {
    font-size: 14px;
    color: #595959;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* Form Groups */
.etsy-form {
    margin: 0;
    padding: 0;
}

.etsy-form-group {
    margin-bottom: 16px;
    position: relative;
}

.etsy-form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    color: #222222;
    margin-bottom: 6px;
    line-height: 1.3;
}

.etsy-required {
    color: #c92a2a;
    margin-left: 2px;
    font-weight: 700;
}

/* Inputs */
.etsy-input {
    width: 100% !important;
    height: 48px !important;
    border: 1.5px solid #767676 !important;
    border-radius: 8px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
    color: #222222 !important;
    background-color: #ffffff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    margin: 0 !important;
    line-height: 48px !important;
    box-shadow: none !important;
}

.etsy-input::placeholder {
    color: #717171 !important;
    opacity: 1 !important;
}

.etsy-input:focus {
    border-color: #222222 !important;
    outline: none !important;
    box-shadow: 0 0 0 1px #222222 !important;
}

/* Password Input with eye toggle */
.etsy-password-wrap {
    position: relative;
    width: 100%;
}

.etsy-input-password {
    padding-right: 48px !important;
}

.etsy-pwd-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #595959;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.etsy-pwd-toggle-btn:hover {
    color: #222222;
    background-color: #f5f5f5;
}

.etsy-eye-icon {
    display: block;
}

/* Buttons */
.etsy-btn {
    width: 100%;
    height: 48px;
    border-radius: 9999px;
    font-size: 15.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    line-height: 1.2;
    margin: 0;
}

/* Primary Button (Sign in / Register / Submit) */
.etsy-btn-primary {
    background-color: #2B2631;
    color: #ffffff;
    margin-top: 14px;
}

.etsy-btn-primary:hover {
    background-color: #16131a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.etsy-btn-primary:active {
    transform: scale(0.99);
}

/* Outline Button (Reset password / Google) */
.etsy-btn-outline {
    background-color: transparent;
    border: 1.5px solid #222222;
    color: #222222;
}

.etsy-btn-outline:hover {
    background-color: #f7f7f7;
    color: #222222;
}

.etsy-btn-outline:active {
    transform: scale(0.99);
}

/* Loading Spinner on button */
.etsy-btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.etsy-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: etsySpin 0.7s linear infinite;
    margin-left: 8px;
}

.etsy-btn-outline .etsy-btn-spinner {
    border-color: rgba(34, 34, 34, 0.3);
    border-top-color: #222222;
}

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

/* Dividers: horizontal line with "or" */
.etsy-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: #595959;
}

.etsy-divider::before,
.etsy-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e2e2;
}

.etsy-divider-text {
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: #595959;
    text-transform: lowercase;
}

/* Forgot Password Section */
.etsy-forgot-pwd-section {
    width: 100%;
}

.etsy-forgot-pwd-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 700;
    color: #222222;
    text-align: left;
}

.etsy-btn-reset-pwd {
    height: 44px;
    margin-bottom: 12px;
}

.etsy-trouble-wrap {
    text-align: center;
}

.etsy-trouble-link {
    background: none;
    border: none;
    padding: 4px;
    font-size: 13.5px;
    color: #222222;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s ease;
    display: inline-block;
}

.etsy-trouble-link:hover {
    opacity: 0.75;
}

.etsy-back-to-signin {
    margin-top: 16px;
    text-align: center;
}

/* Social Buttons */
.etsy-social-section {
    width: 100%;
}

.etsy-btn-google {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
}

.etsy-google-icon {
    flex-shrink: 0;
}

/* Legal text */
.etsy-modal-legal {
    margin-top: 18px;
    font-size: 12px;
    color: #595959;
    line-height: 1.45;
}

.etsy-modal-legal p {
    margin: 0 0 8px 0;
}

.etsy-modal-legal p:last-child {
    margin-bottom: 0;
}

.etsy-modal-legal a {
    color: #222222;
    text-decoration: underline;
    font-weight: 500;
}

.etsy-modal-legal a:hover {
    color: #000000;
}

/* Inline Alert / Notification Banner */
.etsy-signin-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.4;
    gap: 10px;
    animation: etsyFadeDown 0.25s ease-out;
}

@keyframes etsyFadeDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.etsy-signin-alert-banner.is-error {
    background-color: #fdf2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.etsy-signin-alert-banner.is-info {
    background-color: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

.etsy-signin-alert-banner.is-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.etsy-alert-text {
    flex: 1;
    font-weight: 500;
}

.etsy-alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: currentColor;
    opacity: 0.6;
    padding: 0 4px;
    line-height: 1;
}

.etsy-alert-close:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .etsy-signin-box {
        padding: 28px 20px 24px 20px;
        border-radius: 18px;
    }
    .etsy-modal-title {
        font-size: 22px;
    }
    .etsy-modal-switch-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}
