/* =============================================
   EC AUTH MODAL
   ============================================= */

.ec-auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.ec-auth-overlay.is-open {
    display: flex;
}

/* Box */
.ec-auth-box {
    width: 860px;
    max-width: 96vw;
    min-height: 580px;
    background: linear-gradient(135deg, #fffffe 0%, #e5e5dc 100%);
    /* matches order confirmation body */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
}

/* ---- DARK SLIDING PANEL ---- */
.ec-auth-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 44%;
    height: 100%;
    background: linear-gradient(135deg, #C2A25D 0%, #0f1117 100%);
    /* matches order confirmation header gradient */
    z-index: 10;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Gold circle decorations */
.ec-auth-dark::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.ec-auth-dark::after {
    content: '';
    position: absolute;
    bottom: -70px;
    left: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

/* Signup mode: dark panel slides to the right */
.ec-auth-box.signup-mode .ec-auth-dark {
    transform: translateX(127.3%);
    /* 44% panel moves to cover right 56%: (56/44)*100 = 127.3% */
}

.ec-auth-dark__inner {
    position: relative;
    z-index: 1;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ec-auth-logo {
    height: 100px;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
    object-fit: contain;
    object-position: left;
}

.ec-auth-dark__title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 12px;
}

.ec-auth-dark__title span {
    color: rgba(255, 255, 255, 0.7);
}

.ec-auth-dark__sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
    margin-bottom: 24px;
}

.ec-auth-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 24px;
}

.ec-auth-features li {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
}

.ec-feat-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- CLOSE BUTTON ---- */
.ec-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    /* always above panels */
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.ec-auth-close:hover {
    background: #fff;
    color: #111;
}

/* ---- FORM PANELS ---- */
/* Both panels fill the box; dark panel covers one at a time */
.ec-form-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 56%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    transition: opacity 0.3s ease 0.15s;
}

/* Signin always on the RIGHT */
.ec-form-panel--signin {
    right: 0;
    left: auto;
}

/* ---- FORM ELEMENTS ---- */
.ec-auth-panel__head {
    margin-bottom: 15px;
    margin-top: 10px;
}

.ec-auth-panel__head h3 {
    font-size: 22px;
    font-weight: 700;
    color: #0f1117;
    margin-bottom: 4px;
}

.ec-auth-panel__head p {
    font-size: 13px;
    color: #999;
}

.ec-social-stack {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 12px;
}

.ec-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.ec-social-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
    transform: translateY(-1px);
}

.ec-social-btn--google {
    border-color: #dadce0;
}

.ec-social-btn--facebook {
    border-color: #1877f2;
    color: #1877f2;
}

/* Makes the scrollbar look cleaner inside the modal */
.ec-form-panel::-webkit-scrollbar {
    width: 5px;
}

.ec-form-panel::-webkit-scrollbar-thumb {
    background: #C2A25D;
    border-radius: 10px;
}

.ec-auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    font-size: 11px;
    color: #ccc;
}

.ec-auth-divider::before,
.ec-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ebebeb;
}

.ec-auth-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.ec-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ec-field label {
    font-size: 11.5px;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.02em;
}

.ec-auth-box .ec-field-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 12px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ec-field-wrap:focus-within {
    border-color: #C2A25D;
    box-shadow: 0 0 0 3px rgba(194, 162, 93, 0.12);
}

.ec-auth-box .ec-field-wrap svg {
    display: block;
    flex: 0 0 auto;
    margin: 0;
    color: #ccc;
}

.ec-auth-box .ec-field-wrap input,
.ec-auth-box .ec-field-wrap textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none !important;
    outline: none;
    background: transparent;
    box-shadow: none !important;
}

.ec-field-wrap input::placeholder {
    color: #bdbdbd;
}

.ec-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ec-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #777;
    cursor: pointer;
}

.ec-forgot {
    font-size: 12px;
    color: #C2A25D;
    text-decoration: none;
}

.ec-forgot:hover {
    text-decoration: underline;
}

.ec-auth-submit {
    margin-top: 2px;
    background: var(--theme-palette-color-2);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

.ec-auth-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #C2A25D;
}

.ec-auth-submit:hover {
    background: #8f6207;
    transform: translateY(-1px);
}

.ec-auth-switch {
    font-size: 12.5px;
    color: #999;
    text-align: center;
    margin-top: 14px;
}

.ec-switch-btn {
    background: none;
    border: none;
    color: #C2A25D;
    font-weight: 600;
    cursor: pointer;
    font-size: 12.5px;
    text-decoration: underline;
    padding: 0;
}

.ec-auth-terms {
    font-size: 10.5px;
    color: #c0c0c0;
    text-align: center;
    margin-top: 8px;
}

.ec-auth-terms a {
    color: #aaa;
}

.ec-auth-overlay--standalone {
    display: flex !important;
    position: relative;
    inset: auto;
    background: transparent !important;
    backdrop-filter: none;
    padding: 32px 16px;
    min-height: calc(100vh - 120px);
    align-items: center;
    justify-content: center;
    z-index: auto;
}

.ec-auth-overlay--standalone .ec-auth-close {
    display: none;
}

.ec-auth-overlay--standalone .ec-auth-box {
    margin: 0 auto;
}


/* Mobile */
@media (max-width: 660px) {
    .ec-auth-dark {
        display: none;
    }

    .ec-auth-box {
        height: auto;
    }

    .ec-form-panel {
        position: relative;
        width: 100%;
        height: auto;
        opacity: 1 !important;
        pointer-events: auto !important;
        padding: 32px 24px;
        display: none;
    }

    .ec-form-panel--signin {
        display: flex;
    }

    .ec-auth-box.signup-mode .ec-form-panel--signin {
        display: none;
    }

    .ec-auth-box.signup-mode .ec-form-panel--signup {
        display: flex;
    }
}