/* ============================================================
   GF SMS – استایل‌های لیست کاربران + قالب زیبای فرم‌های بومی
   ============================================================ */

/* ---------- User List Advanced ---------- */
.gf-sms-user-list-advanced .user-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}
.gf-sms-user-list-advanced th,
.gf-sms-user-list-advanced td {
    border: 1px solid #eee;
    padding: 12px;
    text-align: center;
}
.gf-sms-user-list-advanced th {
    background-color: #f8f9fa;
    font-weight: bold;
}
.gf-sms-user-list-advanced .meta-cell {
    text-align: right;
    font-size: 0.9em;
}
.gf-sms-user-list-advanced .gf-sms-edit-button {
    background-color: #0073aa;
    color: white !important;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
}
.gf-sms-user-list-advanced .gf-sms-edit-button:hover {
    background-color: #005177;
}
.table-responsive {
    overflow-x: auto;
}

/* ============================================================
   قالب زیبای فرم‌های بومی (Native Forms)
   ============================================================ */

.gf-sms-form-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 0;
    font-family: Tahoma, "IRANSans", "Vazirmatn", system-ui, sans-serif;
    direction: rtl;
}

.gf-sms-form-container .gf-sms-form-message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
}
.gf-sms-form-container .gf-sms-form-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.gf-sms-form-container .gf-sms-form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.gf-sms-native-form {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
}

.gf-sms-native-form::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.gf-sms-native-form .gf-sms-field {
    margin-bottom: 22px;
}

.gf-sms-native-form .gf-sms-field > label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.gf-sms-native-form .gf-sms-field > label .required {
    color: #ef4444;
    margin-right: 2px;
}

.gf-sms-native-form .gf-sms-input,
.gf-sms-native-form input[type="text"],
.gf-sms-native-form input[type="tel"],
.gf-sms-native-form input[type="email"],
.gf-sms-native-form input[type="password"],
.gf-sms-native-form input[type="number"],
.gf-sms-native-form select,
.gf-sms-native-form textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

.gf-sms-native-form .gf-sms-input:focus,
.gf-sms-native-form input:focus,
.gf-sms-native-form select:focus,
.gf-sms-native-form textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.gf-sms-native-form input[type="password"],
.gf-sms-native-form input[type="tel"],
.gf-sms-native-form input[type="email"] {
    direction: ltr;
    text-align: left;
}

/* Phone + OTP */
.gf-sms-phone-wrapper {
    display: flex;
    gap: 10px;
    direction: ltr;
    align-items: stretch;
}

.gf-sms-phone-wrapper .gf-sms-input {
    flex: 1;
}

.gf-sms-send-otp-btn {
    white-space: nowrap;
    padding: 0 16px !important;
    border-radius: 10px !important;
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.gf-sms-send-otp-btn:hover {
    background: #2563eb !important;
}

.gf-sms-send-otp-btn:active {
    transform: scale(0.97);
}

.gf-sms-otp-wrapper {
    margin-top: 12px;
    background: #f1f5f9;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.gf-sms-otp-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
}

.gf-sms-otp-wrapper input {
    letter-spacing: 6px;
    text-align: center;
    font-size: 20px !important;
    font-weight: 700;
    direction: ltr;
}

.gf-sms-timer {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #ef4444;
    font-weight: 600;
}

/* Radio / Checkbox groups */
.gf-sms-native-form .gf-sms-radio-group,
.gf-sms-native-form .gf-sms-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gf-sms-native-form .gf-sms-radio-group label,
.gf-sms-native-form .gf-sms-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    transition: border-color 0.2s, background 0.2s;
}

.gf-sms-native-form .gf-sms-radio-group label:hover,
.gf-sms-native-form .gf-sms-checkbox-group label:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.gf-sms-native-form input[type="radio"],
.gf-sms-native-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* Submit button */
.gf-sms-submit-group {
    margin-top: 28px;
}

.gf-sms-submit-btn {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.gf-sms-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.gf-sms-submit-btn:active {
    transform: translateY(0);
}

.gf-sms-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* فرم‌های کاری داخل سایت: ثبت توسط اپراتور و ویرایش پروفایل */
.gf-sms-form-container.gf-sms-form-type-admin_registration,
.gf-sms-form-container.gf-sms-form-type-single_edit,
.gf-sms-form-container.gf-sms-form-type-admin_edit,
.gf-sms-form-container.gf-sms-form-type-bulk_edit {
    max-width: 1040px;
    width: 100%;
    margin: 24px auto;
}

.gf-sms-form-type-admin_registration .gf-sms-native-form,
.gf-sms-form-type-single_edit .gf-sms-native-form,
.gf-sms-form-type-admin_edit .gf-sms-native-form,
.gf-sms-form-type-bulk_edit .gf-sms-native-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 20px;
    padding: 12px 0;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
    overflow: visible;
}

.gf-sms-form-type-admin_registration .gf-sms-native-form::before,
.gf-sms-form-type-single_edit .gf-sms-native-form::before,
.gf-sms-form-type-admin_edit .gf-sms-native-form::before,
.gf-sms-form-type-bulk_edit .gf-sms-native-form::before {
    display: none;
}

.gf-sms-form-type-admin_registration .gf-sms-field,
.gf-sms-form-type-single_edit .gf-sms-field,
.gf-sms-form-type-admin_edit .gf-sms-field,
.gf-sms-form-type-bulk_edit .gf-sms-field {
    min-width: 0;
    margin: 0;
}

.gf-sms-form-type-admin_registration .gf-sms-field-type-hidden,
.gf-sms-form-type-single_edit .gf-sms-field-type-hidden,
.gf-sms-form-type-admin_edit .gf-sms-field-type-hidden,
.gf-sms-form-type-bulk_edit .gf-sms-field-type-hidden {
    display: none;
}

.gf-sms-form-type-admin_registration .gf-sms-field-type-name_composite,
.gf-sms-form-type-single_edit .gf-sms-field-type-name_composite,
.gf-sms-form-type-admin_edit .gf-sms-field-type-name_composite,
.gf-sms-form-type-bulk_edit .gf-sms-field-type-name_composite,
.gf-sms-form-type-admin_registration .gf-sms-field-type-address_composite,
.gf-sms-form-type-single_edit .gf-sms-field-type-address_composite,
.gf-sms-form-type-admin_edit .gf-sms-field-type-address_composite,
.gf-sms-form-type-bulk_edit .gf-sms-field-type-address_composite {
    grid-column: 1 / -1;
}

.gf-sms-form-type-admin_registration .gf-sms-field > label,
.gf-sms-form-type-single_edit .gf-sms-field > label,
.gf-sms-form-type-admin_edit .gf-sms-field > label,
.gf-sms-form-type-bulk_edit .gf-sms-field > label {
    margin-bottom: 7px;
    font-size: 13px;
    color: #334155;
}

.gf-sms-form-type-admin_registration .gf-sms-input,
.gf-sms-form-type-single_edit .gf-sms-input,
.gf-sms-form-type-admin_edit .gf-sms-input,
.gf-sms-form-type-bulk_edit .gf-sms-input {
    min-height: 46px;
    border-radius: 6px;
    background: #fff;
    border-color: #cbd5e1;
}

.gf-sms-form-type-admin_registration .gf-sms-name-composite,
.gf-sms-form-type-single_edit .gf-sms-name-composite,
.gf-sms-form-type-admin_edit .gf-sms-name-composite,
.gf-sms-form-type-bulk_edit .gf-sms-name-composite,
.gf-sms-form-type-admin_registration .gf-sms-address-composite,
.gf-sms-form-type-single_edit .gf-sms-address-composite,
.gf-sms-form-type-admin_edit .gf-sms-address-composite,
.gf-sms-form-type-bulk_edit .gf-sms-address-composite {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.gf-sms-form-type-admin_registration .gf-sms-submit-group,
.gf-sms-form-type-single_edit .gf-sms-submit-group,
.gf-sms-form-type-admin_edit .gf-sms-submit-group,
.gf-sms-form-type-bulk_edit .gf-sms-submit-group {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    margin-top: 6px !important;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.gf-sms-form-type-admin_registration .gf-sms-submit-btn,
.gf-sms-form-type-single_edit .gf-sms-submit-btn,
.gf-sms-form-type-admin_edit .gf-sms-submit-btn,
.gf-sms-form-type-bulk_edit .gf-sms-submit-btn {
    width: auto;
    min-width: 170px;
    padding: 11px 24px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    box-shadow: 0 2px 7px rgba(37, 99, 235, 0.2);
}

@media (max-width: 760px) {
    .gf-sms-form-type-admin_registration .gf-sms-native-form,
    .gf-sms-form-type-single_edit .gf-sms-native-form,
    .gf-sms-form-type-admin_edit .gf-sms-native-form,
    .gf-sms-form-type-bulk_edit .gf-sms-native-form {
        grid-template-columns: 1fr;
        padding: 22px 18px;
    }
    .gf-sms-form-type-admin_registration .gf-sms-submit-group,
    .gf-sms-form-type-single_edit .gf-sms-submit-group,
    .gf-sms-form-type-admin_edit .gf-sms-submit-group,
    .gf-sms-form-type-bulk_edit .gf-sms-submit-group {
        grid-column: 1;
    }
}

/* Loading state */
.gf-sms-native-form.is-loading .gf-sms-submit-btn {
    position: relative;
    color: transparent !important;
}
.gf-sms-native-form.is-loading .gf-sms-submit-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gf-sms-spin 0.7s linear infinite;
}

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

/* Password field type hide/show helpers */
.gf-sms-field-type-password {
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

/* Error text under fields */
.gf-sms-field-error {
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
}

/* Responsive */
@media (max-width: 520px) {
    .gf-sms-form-container {
        margin: 20px 12px;
    }
    .gf-sms-native-form {
        padding: 24px 18px;
        border-radius: 14px;
    }
    .gf-sms-phone-wrapper {
        flex-direction: column;
    }
    .gf-sms-send-otp-btn {
        width: 100%;
        padding: 12px 16px !important;
    }
}

/* Dark mode soft support */
@media (prefers-color-scheme: dark) {
    .gf-sms-native-form {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    }
    .gf-sms-native-form .gf-sms-field > label {
        color: #f1f5f9;
    }
    .gf-sms-native-form .gf-sms-input,
    .gf-sms-native-form input,
    .gf-sms-native-form select,
    .gf-sms-native-form textarea {
        background: #0f172a;
        border-color: #475569;
        color: #f8fafc;
    }
    .gf-sms-otp-wrapper {
        background: #0f172a;
        border-color: #334155;
    }
}


/* Password show/hide toggle */
.gf-sms-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.gf-sms-password-wrapper .gf-sms-input,
.gf-sms-password-wrapper input {
    width: 100%;
    padding-left: 44px;
}
.gf-sms-toggle-password {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
    z-index: 2;
}
.gf-sms-toggle-password:hover {
    opacity: 1;
}

/* Name composite: first + last side by side */
.gf-sms-name-composite {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.gf-sms-name-composite .gf-sms-name-part {
    flex: 1;
    min-width: 140px;
}
.gf-sms-name-composite .gf-sms-name-part label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #64748b;
}
