:root {
    --meli-primary: #10b981;
    --meli-primary-hover: #059669;
    --meli-bg: #ffffff;
    --meli-text: #1f2937;
    --meli-text-muted: #6b7280;
    --meli-border: #e5e7eb;
    --meli-radius: 14px;
    --meli-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body.meli-modal-open {
    overflow: hidden;
}

.meli-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.meli-modal-container {
    background: var(--meli-bg);
    width: 100%;
    max-width: 420px;
    border-radius: var(--meli-radius);
    box-shadow: var(--meli-shadow);
    position: relative;
    padding: 36px 28px 28px 28px;
    direction: rtl;
    box-sizing: border-box;
    animation: meliFadeScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes meliFadeScale {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.meli-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #f3f4f6;
    border: none;
    font-size: 20px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--meli-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.meli-modal-close:hover {
    background: #e5e7eb;
    color: var(--meli-text);
}

.meli-auth-form {
    width: 100%;
    text-align: right;
    font-family: inherit;
}

.meli-form-header {
    text-align: center;
    margin-bottom: 24px;
}

.meli-form-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--meli-text);
    margin: 0 0 8px 0;
}

.meli-form-subtitle {
    font-size: 13px;
    color: var(--meli-text-muted);
    margin: 0;
}

.meli-form-group {
    margin-bottom: 18px;
}

.meli-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--meli-text);
    margin-bottom: 6px;
}

.meli-input {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--meli-border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--meli-text);
    outline: none;
    box-sizing: border-box;
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.meli-input.ltr {
    direction: ltr;
    text-align: left;
}

.meli-input:focus {
    border-color: var(--meli-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.meli-otp-input {
    letter-spacing: 8px;
    text-align: center !important;
    font-weight: 700;
    font-size: 20px;
}

.meli-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.meli-btn-primary {
    background: var(--meli-primary);
    color: #ffffff;
}

.meli-btn-primary:hover {
    background: var(--meli-primary-hover);
}

.meli-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.meli-resend-wrapper {
    text-align: center;
    margin-top: 14px;
}

.meli-resend-code {
    font-size: 12px;
    color: var(--meli-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.meli-resend-code:hover {
    color: var(--meli-primary);
}

.meli-alert {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.meli-alert-danger {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

.meli-alert-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

.meli-checkout-alert {
    background: #f8fafc;
    border: 1px dashed var(--meli-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    direction: rtl;
}

.meli-checkout-alert-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--meli-text);
    margin: 0 0 6px 0;
}

.meli-checkout-alert-desc {
    font-size: 14px;
    color: var(--meli-text-muted);
    margin: 0 0 14px 0;
}

.meli-checkout-btn {
    max-width: 200px;
    margin: 0 auto;
}