/* =========================================
   Amoot Auth - Clean & Modern UI
   ========================================= */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --radius: 12px;
    --transition: all 0.2s ease;
}

/* Container */
.amoot-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: inherit;
}

/* Card */
.amoot-card {
    background: #fff;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

/* Title */
.amoot-card h3 {
    text-align: center;
    color: var(--gray-800);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

/* Steps */
.amoot-step {
    display: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.amoot-step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Inputs */
.amoot-step input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: var(--transition);
    margin-bottom: 12px;
    box-sizing: border-box;
    text-align: right;
    direction: rtl;
    outline: none;
}

.amoot-step input[type="text"]::placeholder {
    color: var(--gray-400);
}

.amoot-step input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Primary Buttons */
.amoot-step>button:not(.amoot-resend-btn) {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.amoot-step>button:not(.amoot-resend-btn):hover {
    background: var(--primary-hover);
}

.amoot-step>button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loader */
.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.amoot-step button.loading .btn-text {
    visibility: hidden;
}

.amoot-step button.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Meta Area (Timer + Resend) */
.amoot-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    direction: rtl;
}

/* Timer */
#amoot_timer {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    display: none;
    /* با جاوا نمایش داده می‌شود */
}

/* Resend Buttons */
.amoot-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.amoot-resend-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.amoot-resend-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.resend-icon {
    font-size: 14px;
}

/* Message Box */
#amoot_msg {
    margin-top: 16px;
    margin-bottom: 0;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
    display: none;
    border-right: 4px solid transparent;
}

#amoot_msg:not(:empty) {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message Variants */
#amoot_msg.msg-error {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

#amoot_msg.msg-sms {
    background: #f0fdf4;
    border-color: var(--success);
    color: #166534;
}

#amoot_msg.msg-bale {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

#amoot_msg.msg-voice {
    background: #f8fafc;
    border-color: var(--gray-500);
    color: #475569;
}

/* Name Box */
#amoot_name_box {
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    .amoot-card {
        padding: 24px 20px;
    }

    .amoot-meta {
        flex-direction: column;
        gap: 8px;
    }

    .amoot-resend-btn {
        width: 100%;
        justify-content: center;
    }

    #amoot_timer {
        width: 100%;
        text-align: center;
    }
}

/* Logged In Message */
.amoot-auth-logged-in {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 16px;
    color: #166534;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    max-width: 400px;
    margin: 20px auto;
}