/* Mobile Auth UI Styles - Persian RTL */
body {
    font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #1d1d1f;
    direction: rtl;
}

/* Constrain to mobile width on larger screens; design is mobile-only */
main {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.auth-page {
    min-height: 100vh;
    padding: 24px 20px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #ffffff;
    direction: rtl;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #1d1d1f;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: rotate(180deg);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 12px 0 8px;
}

.page-subtitle {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    background: #ffffff;
    color: #111827;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.12);
}

.form-textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* RTL: dropdown arrow on left */
.form-select {
    text-align: right;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 40px;
    padding-right: 14px;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.country-code {
    width: 64px;
    text-align: center;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 10px;
    font-size: 14px;
}

.primary-btn {
    width: 100%;
    padding: 14px 16px;
    background: #ff6a00;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 18px;
}

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

.link-muted {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
}

.link-primary {
    color: #ff6a00;
    text-decoration: none;
    font-weight: 600;
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 18px 0 8px;
}

.otp-input {
    width: 44px;
    height: 44px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.otp-input:focus {
    outline: none;
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.12);
}

.helper-row {
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
}

.toggle-group {
    display: flex;
    gap: 10px;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 18px;
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    color: #6b7280;
    font-weight: 600;
}

.toggle-btn.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.form-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.6;
}

.form-note .link-primary {
    font-weight: 700;
}

/* Login page only - minimal, centered */
.login-page {
    justify-content: center;
    padding: 40px 24px 32px;
}

.login-form {
    width: 100%;
    max-width: 100%;
}

.login-input {
    width: 100%;
    margin-bottom: 4px;
    text-align: right;
}

.login-input::placeholder {
    color: #9ca3af;
}

.login-error {
    font-size: 13px;
    color: #dc2626;
    margin: 8px 0 0;
    text-align: right;
}

.register-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ff6a00;
    text-decoration: none;
}

.register-link:hover {
    color: #e55f00;
    text-decoration: none;
}

.map-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    margin: 12px 0 16px;
}

.map-card-select {
    position: relative;
}

.map-container {
    width: 100%;
    height: 280px;
    /* Contain Neshan attribution (inline z-index 999999) so it cannot stack above modals */
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.map-location-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
}

.map-location-btn:hover {
    background: #f9fafb;
}

.map-search-icon {
    color: #9ca3af;
    flex-shrink: 0;
}

.map-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
}

.map-search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 13px;
}

.pending-card {
    margin: 24px auto 0;
    background: #f4f4f5;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.pending-page {
    justify-content: center;
    padding: 24px 20px;
}

.pending-title {
    font-size: 18px;
    font-weight: 700;
    color: #166534;
    margin: 0 0 12px;
}

.pending-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
    margin: 0 0 20px;
    text-align: center;
}

.pending-btn {
    display: block;
    text-align: center;
    text-decoration: none;
}

.pending-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #e6f8ec;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    font-size: 28px;
}

.rejected-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fef2f2;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 28px;
}

.loading-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid #fde7d4;
    border-top-color: #ff6a00;
    animation: spin 1s linear infinite;
}

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

/* Map modal for address selection */
.map-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.map-modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 16px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.map-modal-content .map-container {
    height: 320px;
}

.map-modal-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px 14px;
    background: #ffffff;
}

.map-modal-actions .primary-btn,
.map-modal-actions .secondary-btn {
    margin-top: 0;
}

.secondary-btn {
    flex: 1;
    padding: 14px 16px;
    background: #f3f4f6;
    color: #111827;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.map-hint-text {
    font-size: 12px;
    color: #6b7280;
    padding: 6px 10px 10px;
    margin: 0;
}
