/* ==============================
   تنسيقات صفحات الدخول والتسجيل - محسّنة
   ============================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f0fdfa 0%, #ecfeff 40%, #e0f2fe 100%);
    padding: 24px 16px;
    position: relative;
    overflow-x: hidden;
}

/* دوائر خلفية خفيفة */
.auth-page::before,
.auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.auth-page::before {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.12) 0%, transparent 70%);
    top: -80px;
    right: -80px;
}

.auth-page::after {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    bottom: -60px;
    left: -60px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 460px;
    padding: 36px 28px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: cardIn 0.45s ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header .logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    margin: 0 auto 14px;
    color: white;
    box-shadow: 0 10px 20px rgba(13, 148, 136, 0.25);
}

.auth-header h1 {
    font-size: 1.65rem;
    color: #0f172a;
    margin-bottom: 6px;
    font-weight: 700;
}

.auth-header p {
    color: #64748b;
    font-size: 0.95rem;
}

/* ===== النماذج ===== */
.auth-form .form-group {
    margin-bottom: 16px;
    position: relative;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13.5px;
    color: #334155;
}

.auth-form .form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.25s ease;
    background: #f8fafc;
    color: #0f172a;
}

.auth-form .form-control:hover {
    border-color: #cbd5e1;
}

.auth-form .form-control:focus {
    border-color: #0d9488;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.auth-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.auth-form select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 36px;
}

/* ===== أزرار ===== */
.auth-form .btn {
    margin-top: 10px;
    padding: 14px;
    font-size: 16px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.auth-form .btn-primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.auth-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}

.auth-form .btn-primary:active {
    transform: translateY(0);
}

.auth-form .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===== تذييل ===== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #64748b;
}

.auth-footer a {
    color: #0d9488;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #0f766e;
    text-decoration: underline;
}

/* ===== اختيار نوع الحساب ===== */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.role-option {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f8fafc;
}

.role-option:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.role-option.active {
    border-color: #0d9488;
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.role-option .icon {
    font-size: 30px;
    margin-bottom: 8px;
    transition: transform 0.25s ease;
}

.role-option.active .icon {
    transform: scale(1.1);
}

.role-option .title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.role-option input {
    display: none;
}

/* ===== رسالة الخطأ ===== */
.error-message {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    margin-bottom: 16px;
    display: none;
    border: 1px solid #fecaca;
    animation: shake 0.35s ease;
}

.error-message.show {
    display: block;
}

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

/* ===== زر العودة ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 18px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #0d9488;
}

/* ===== مؤشر تطابق كلمة المرور ===== */
.password-match {
    font-size: 12.5px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

.password-match.show {
    display: block;
}

.password-match.match {
    color: #16a34a;
}

.password-match.not-match {
    color: #dc2626;
}

/* ===== قسم حقول المؤسسة ===== */
#provider-fields {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 16px 8px;
    margin-bottom: 18px;
    animation: fadeSlide 0.3s ease;
}

#provider-fields .section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0d9488;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== تجاوب ===== */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .auth-header h1 {
        font-size: 1.45rem;
    }

    .role-option {
        padding: 14px 8px;
    }

    .role-option .icon {
        font-size: 26px;
    }
}
