/* =======================================================
   Authentication Pages
========================================================= */

.portal-auth-page {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #f5f8fa;
}

/* الخلفية المتحركة */
.portal-auth-page::before {
    content: '';
    position: absolute;
    inset: -40px;
    z-index: -2;
    background-image: url('../../../images/cup.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: portalAuthBackground 18s ease-in-out infinite alternate;
    will-change: transform;
}

/* طبقة تغميق فوق الصورة */
.portal-auth-page::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(20, 10, 35, .45);
}

@keyframes portalAuthBackground {
    0% {
        transform: scale(1.05) translate3d(0, 0, 0);
    }

    100% {
        transform: scale(1.13) translate3d(-1.5%, 1%, 0);
    }
}

/* الحاوية */
.portal-auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
}

/* الكارد */
body.identity-portal .portal-auth-card {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    overflow: hidden;
}

body.identity-portal .portal-auth-card .card-body {
    padding: 32px;
}

/* Header */
.portal-auth-header {
    margin-bottom: 28px;
}

.portal-auth-logo {
    display: block;
    width: 150px;
    max-width: 80%;
    height: auto;
    margin: 0 auto;
}

.portal-auth-title {
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.portal-auth-subtitle {
    margin-bottom: 0;
    line-height: 1.7;
}

/* Form */
.portal-auth-form .form-group {
    margin-bottom: 20px;
}

.portal-auth-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.portal-input-group .form-control,
.portal-input-group .input-group-text {
    min-height: 48px;
}

.portal-input-group .form-control {
    font-size: 16px;
}

.portal-input-group .input-group-text {
    min-width: 48px;
    justify-content: center;
}

.portal-password-toggle {
    border: 0;
    cursor: pointer;
    outline: none;
}

.portal-password-toggle:focus {
    box-shadow: none;
}

/* Buttons */
.portal-login-btn,
.portal-secondary-btn {
    min-height: 50px;
    border-radius: 8px;
    font-weight: 600;
}

.portal-login-btn {
    margin-top: 8px;
}

/* Links */
.portal-auth-link,
.portal-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
}

/* Divider */
.portal-auth-divider {
    position: relative;
    text-align: center;
    margin: 22px 0;
}

.portal-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1px;
    background: #e9ecef;
}

.portal-auth-divider span {
    position: relative;
    padding: 0 12px;
    background: #fff;
    color: #adb5bd;
    font-size: 14px;
}

/* Footer */
.portal-auth-footer {
    padding-top: 18px;
}

.portal-auth-footer small,
.portal-auth-footer a {
    color: #fff !important;
}

/* Mobile / WebView */
@media (max-width: 575.98px) {
    .portal-auth-page {
        padding: 16px 12px;
    }

    .portal-auth-wrapper {
        max-width: 100%;
    }

    body.identity-portal .portal-auth-card {
        border-radius: 14px;
    }

    body.identity-portal .portal-auth-card .card-body {
        padding: 24px 20px;
    }

    .portal-auth-header {
        margin-bottom: 24px;
    }

    .portal-auth-logo {
        width: 115px;
    }
}

/* احترام إعداد تقليل الحركة في الجهاز */
@media (prefers-reduced-motion: reduce) {
    .portal-auth-page::before {
        animation: none;
        transform: scale(1.05);
    }
}



.portal-auth-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.portal-language-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.portal-auth-terms {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #eee;
    font-size: 14px;
    line-height: 1.8;
    color: #6c757d;
}

.portal-auth-terms a {
    font-weight: 500;
}
.portal-auth-form input[type="email"],
.portal-auth-form input[type="password"] {
    direction: ltr;
    text-align: left;
}
.portal-ltr-input {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.portal-select-group {
    position: relative;
}

.portal-select-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    z-index: 5;
    color: var(--primary-color);
    pointer-events: none;
}

.portal-select-group .select2-container {
    width: 100% !important;
}

.portal-select-group .select2-selection {
    min-height: 48px;
    border-radius: 8px !important;
    border: 1px solid #ccc !important;
}

.portal-select-group .select2-selection__rendered {
    line-height: 46px !important;
    padding-right: 42px !important;
}

.portal-select-group .select2-selection__arrow {
    height: 46px !important;
}

.portal-phone-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.portal-phone-control {
    direction: ltr;
    display: flex;
    width: 100%;
    height: 52px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.portal-phone-control:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(92, 45, 145, .15);
}

.portal-phone-code-select {
    flex: 0 0 105px;
    width: 105px;
    height: 100%;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid #e2e2e2;
    background: #f8f9fa;
    font-size: 16px;
    text-align: center;
    outline: none;
    color: #333;
}

.portal-phone-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 16px;
    border: 0;
    outline: none;
    background: transparent;
    direction: ltr;
    text-align: left;
    font-size: 16px;
}

.portal-phone-input::placeholder {
    color: #adb5bd;
}


.portal-auth-wrapper-wide {
    max-width: 480px;
}

.portal-photo-card-body {
    padding-bottom: 20px !important;
}

.portal-photo-upload {
    margin-top: 10px;
}

.portal-photo-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8f9fa;
    font-size: 14px;
    line-height: 1.7;
}

.portal-photo-note i {
    margin-top: 3px;
    color: var(--primary-color);
}

.portal-sticky-action {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 14px 20px;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #eee;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .05);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .portal-sticky-action {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 575.98px) {
    .portal-photo-card-body {
        padding-bottom: 12px !important;
    }

    .portal-sticky-action {
        padding: 12px 16px;
    }
}
@media (max-width: 575.98px) {
    .portal-auth-toolbar {
        margin-bottom: 8px;
    }

    .portal-auth-terms {
        margin-top: 20px;
        padding-top: 16px;
        font-size: 14px;
    }
}



.portal-midan-list {
    max-width: 1100px;
    margin-right: auto;
    margin-left: auto;
}

.portal-midan-list-card {
    overflow: hidden;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .045);
}

.portal-midan-main-link {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 135px;
    padding: 18px;
    color: inherit;
    text-decoration: none !important;
}

.portal-midan-main-link:active {
    background: #fafafa;
}

.portal-midan-list-logo {
    flex: 0 0 92px;
    width: 92px;
    height: 92px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;
    background: #fafafa;
    overflow: hidden;
}

.portal-midan-list-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-midan-list-info {
    flex: 1;
    min-width: 0;
}

.portal-midan-list-name {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: #333;
}

.portal-midan-open {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 600;
}

.portal-midan-open i {
    font-size: 13px;
}

.portal-midan-social {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 18px 14px;

    border-top: 1px solid #f1f1f1;
}

.portal-midan-social .social-btn {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    text-decoration: none;
    font-size: 15px;
}

@media (max-width: 575.98px) {
    .portal-midan-main-link {
        min-height: 120px;
        padding: 14px;
        gap: 14px;
    }

    .portal-midan-list-logo {
        flex-basis: 78px;
        width: 78px;
        height: 78px;
    }

    .portal-midan-list-name {
        font-size: 18px;
    }

    .portal-midan-social {
        padding: 10px 14px 12px;
    }
}


.portal-midan-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 110px;
}
