/* Lemira OTP Auth Styles */

/* Modal Overlay */
.lemira-otp-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

.lemira-otp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.lemira-otp-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close Button */
.lemira-otp-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    border-radius: 8px;
    z-index: 10;
}

.lemira-otp-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Modal Header */
.lemira-otp-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.lemira-otp-modal-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.lemira-otp-modal-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Modal Body */
.lemira-otp-modal-body {
    padding: 32px;
}

/* Steps */
.lemira-otp-step {
    display: none;
}

.lemira-otp-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Form Group */
.lemira-otp-form-group {
    margin-bottom: 24px;
}

.lemira-otp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.lemira-otp-form-group input[type="tel"],
.lemira-otp-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    direction: ltr;
    text-align: center;
}

.lemira-otp-form-group input:focus {
    outline: none;
    border-color: #C5A572;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

/* OTP Code Inputs */
.lemira-otp-code-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    direction: ltr;
}

.lemira-otp-code-input {
    width: 48px;
    height: 56px;
    padding: 0;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 600;
    transition: all 0.2s;
}

.lemira-otp-code-input:focus {
    outline: none;
    border-color: #C5A572;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

/* Phone Display */
.lemira-otp-phone-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.lemira-otp-phone-display p {
    margin: 0 0 4px;
    font-size: 14px;
    color: #666;
}

.lemira-otp-phone-display strong {
    display: block;
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 8px;
    direction: ltr;
}

.lemira-otp-edit-phone {
    background: transparent;
    border: none;
    color: #C5A572;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s;
}

.lemira-otp-edit-phone:hover {
    text-decoration: underline;
}

/* Timer */
.lemira-otp-timer {
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
}

.lemira-otp-timer.expired {
    color: #dc3545;
}

/* Buttons */
.lemira-otp-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.lemira-otp-btn-primary {
    background: #C5A572;
    color: #fff;
}

.lemira-otp-btn-primary:hover:not(:disabled) {
    background: #b39563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 165, 114, 0.3);
}

.lemira-otp-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lemira-otp-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.lemira-otp-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.lemira-otp-btn-link {
    background: transparent;
    color: #C5A572;
    margin-top: 12px;
}

.lemira-otp-btn-link:hover:not(:disabled) {
    background: #f8f9fa;
}

.lemira-otp-btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Spinner */
.btn-loader {
    display: none !important;
}

.lemira-otp-btn.loading .btn-text {
    display: none;
}

.lemira-otp-btn.loading .btn-loader {
    display: inline-block !important;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 24px;
    height: 24px;
}

.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Error Message */
.lemira-otp-error {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 8px;
}

/* Privacy Text */
.lemira-otp-privacy {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 16px;
}

.lemira-otp-privacy a {
    color: #C5A572;
    text-decoration: none;
}

.lemira-otp-privacy a:hover {
    text-decoration: underline;
}

/* Success Step */
#lemira-otp-step-success {
    text-align: center;
    padding: 40px 20px;
}

.lemira-otp-success-icon {
    color: #28a745;
    margin-bottom: 24px;
}

.lemira-otp-success-icon svg {
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

#lemira-otp-step-success h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a1a1a;
}

#lemira-otp-step-success p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Inline Login Button */
.lemira-otp-login-inline {
    text-align: center;
    padding: 40px 20px;
}

.lemira-otp-show-modal {
    display: inline-block;
    padding: 14px 32px;
    background: #C5A572;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.lemira-otp-show-modal:hover {
    background: #b39563;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 165, 114, 0.3);
}

/* Logged In State */
.lemira-otp-logged-in {
    text-align: center;
    padding: 40px 20px;
}

.lemira-otp-logged-in p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

/* Responsive */
@media (max-width: 576px) {
    .lemira-otp-modal {
        padding: 0;
        align-items: flex-end;
    }

    .lemira-otp-modal-content {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
    }

    .lemira-otp-modal-header,
    .lemira-otp-modal-body {
        padding: 24px;
    }

    .lemira-otp-code-input {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .lemira-otp-code-inputs {
        gap: 8px;
    }
}

/* RTL Support */
[dir="rtl"] .lemira-otp-modal-close {
    left: auto;
    right: 16px;
}

/* Animation for input error */
.lemira-otp-form-group.error input {
    border-color: #dc3545;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ===================================================================
   SHAHKAR MODAL STYLES
   =================================================================== */

.lemira-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

.lemira-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.lemira-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.lemira-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    border-radius: 8px;
    z-index: 10;
    font-size: 24px;
    line-height: 1;
}

.lemira-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.lemira-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.lemira-modal-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.lemira-modal-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.lemira-modal-body {
    padding: 32px;
}

.lemira-shahkar-step {
    display: none;
}

.lemira-shahkar-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.lemira-form-group {
    margin-bottom: 24px;
}

.lemira-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.lemira-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    direction: ltr;
    text-align: center;
}

.lemira-input:focus {
    outline: none;
    border-color: #C5A572;
    box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

.lemira-input-help {
    margin: 8px 0 0;
    font-size: 13px;
    color: #666;
}

.lemira-form-actions {
    margin-top: 24px;
}

.lemira-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.lemira-btn-primary {
    background: #C5A572;
    color: #fff;
}

.lemira-btn-primary:hover:not(:disabled) {
    background: #b39563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 165, 114, 0.3);
}

.lemira-btn-primary:disabled,
.lemira-btn-primary.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.lemira-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.lemira-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.lemira-btn-text {
    display: inline-block;
}

.lemira-btn-loader {
    display: none;
}

.lemira-btn.loading .lemira-btn-text {
    display: none;
}

.lemira-btn.loading .lemira-btn-loader {
    display: inline-block;
}

.lemira-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.lemira-error-message {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff5f5;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.lemira-success-animation,
.lemira-error-animation {
    text-align: center;
    margin-bottom: 24px;
}

.lemira-checkmark,
.lemira-errormark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.lemira-checkmark-circle {
    stroke: #28a745;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-miterlimit: 10;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.lemira-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
    stroke: #28a745;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lemira-errormark-circle {
    stroke: #dc3545;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-miterlimit: 10;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.lemira-errormark-cross {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
    stroke: #dc3545;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.lemira-shahkar-step h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a1a1a;
    text-align: center;
}

.lemira-success-message,
.lemira-error-detail {
    margin: 0 0 24px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* Prevent closing on checkout when not validated */
.lemira-modal[data-checkout="1"][data-validated="0"] .lemira-modal-backdrop {
    cursor: not-allowed;
}

.lemira-modal[data-checkout="1"][data-validated="0"] .lemira-modal-close {
    display: none !important;
}

/* Responsive */
@media (max-width: 576px) {
    .lemira-modal {
        padding: 0;
        align-items: flex-end;
    }

    .lemira-modal-content {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
    }

    .lemira-modal-header,
    .lemira-modal-body {
        padding: 24px;
    }
}

/* RTL Support */
[dir="rtl"] .lemira-modal-close {
    left: auto;
    right: 16px;
}

