/**
 * Compact checkout login — SMS Hub BD
 */

.sgwc-checkout-login {
    margin: 0 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.sgwc-checkout-login__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.sgwc-checkout-login__intro {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sgwc-checkout-login__title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.sgwc-checkout-login__hint {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.sgwc-checkout-login__toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1.5px solid #0d9488;
    border-radius: 10px;
    background: #fff;
    color: #0d9488;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.sgwc-checkout-login__toggle:hover,
.sgwc-checkout-login__toggle:focus {
    background: #0d9488;
    color: #fff;
    outline: none;
}

.sgwc-checkout-login__toggle-close {
    display: none;
}

.sgwc-checkout-login.is-open .sgwc-checkout-login__toggle-open {
    display: none;
}

.sgwc-checkout-login.is-open .sgwc-checkout-login__toggle-close {
    display: inline;
}

.sgwc-checkout-login__panel {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid #eef2f7;
}

.sgwc-checkout-login.is-open .sgwc-checkout-login__panel {
    display: block !important;
}

.sgwc-checkout-login__alert {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.sgwc-checkout-login__alert[hidden] {
    display: none !important;
}

.sgwc-checkout-login__alert.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.sgwc-checkout-login__alert.is-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.sgwc-checkout-login__alert.is-info {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sgwc-checkout-login__form {
    margin-top: 12px;
}

.sgwc-checkout-login__row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.sgwc-checkout-login__field {
    display: flex;
    align-items: center;
    min-width: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sgwc-checkout-login__field:focus-within {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.sgwc-checkout-login__field--phone {
    flex: 1.1 1 0;
}

.sgwc-checkout-login__field--password {
    flex: 1 1 0;
}

.sgwc-checkout-login__prefix {
    flex-shrink: 0;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    line-height: 44px;
}

.sgwc-checkout-login__input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-width: 0;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 16px !important; /* prevents iOS zoom */
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
    outline: none;
}

.sgwc-checkout-login__input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.sgwc-checkout-login__submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 96px;
    min-height: 44px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #0d9488;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.sgwc-checkout-login__submit:hover,
.sgwc-checkout-login__submit:focus {
    background: #0f766e;
    outline: none;
}

.sgwc-checkout-login__form.is-loading .sgwc-checkout-login__submit {
    opacity: 0.75;
    pointer-events: none;
}

.sgwc-checkout-login__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sgwc-checkout-login-spin 0.7s linear infinite;
}

@keyframes sgwc-checkout-login-spin {
    to {
        transform: rotate(360deg);
    }
}

.sgwc-checkout-login .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .sgwc-checkout-login {
        margin: 0;
    }

    .sgwc-checkout-login__bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
    }

    .sgwc-checkout-login__title {
        font-size: 14px;
    }

    .sgwc-checkout-login__hint {
        font-size: 11px;
    }

    .sgwc-checkout-login__toggle {
        width: 100%;
        min-height: 42px;
    }

    .sgwc-checkout-login.is-open .sgwc-checkout-login__panel {
        display: block !important;
        padding: 0 12px 12px;
    }

    .sgwc-checkout-login__form {
        margin-top: 8px;
    }

    .sgwc-checkout-login__alert {
        margin-top: 8px;
    }

    .sgwc-checkout-login__row {
        flex-direction: column;
        gap: 8px;
    }

    .sgwc-checkout-login__field,
    .sgwc-checkout-login__field--phone,
    .sgwc-checkout-login__field--password {
        flex: none;
        width: 100%;
    }

    .sgwc-checkout-login__input {
        font-size: 16px !important;
    }

    .sgwc-checkout-login__submit {
        width: 100%;
        min-height: 46px;
        height: 46px;
    }
}
