/* ==========================================================
   infocard – Login / Register premium design (centered card)
   Used by resources/views/auth/login.blade.php & register.blade.php
   ========================================================== */

/* ---------- page background (only when .ap-page is on the page) ---------- */
body:has(.ap-page) {
    background: #f7f5ff !important;
}
body:has(.ap-page) .authImage {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(
            700px 500px at 0% 0%,
            rgba(108, 60, 245, 0.18),
            transparent 60%
        ),
        radial-gradient(
            600px 500px at 100% 100%,
            rgba(255, 77, 46, 0.14),
            transparent 60%
        ),
        linear-gradient(180deg, #f7f5ff, #fbfaff) !important;
}
body:has(.ap-page) .authImage::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(
        rgba(108, 60, 245, 0.1) 1px,
        transparent 1px
    );
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(
        circle at 50% 35%,
        #000 0,
        transparent 70%
    );
    mask-image: radial-gradient(circle at 50% 35%, #000 0, transparent 70%);
}

/* language button (comes from layouts/auth) -> top right */
body:has(.ap-page) .authImage > .dropdown {
    position: absolute !important;
    top: 26px;
    right: 32px;
    z-index: 30 !important;
    margin: 0 !important;
}
body:has(.ap-page) .authImage.rtl > .dropdown {
    right: auto;
    left: 32px;
}
body:has(.ap-page) .authImage > .dropdown > .btn {
    margin: 0 !important;
    height: 46px;
    padding: 0 18px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff !important;
    color: #2a2e45 !important;
    border: 1px solid #e6e8f0 !important;
    border-radius: 12px !important;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 18px rgba(40, 20, 120, 0.06) !important;
}
body:has(.ap-page) .authImage > .dropdown > .btn i {
    color: #6c3cf5;
}

/* ---------- page wrapper ---------- */
.ap-page {
    --ap-p: #6c3cf5;
    --ap-p2: #8b5cf6;
    --ap-pd: #4c1fd1;
    --ap-ink: #0f1222;
    --ap-mute: #6b7085;
    --ap-line: #e6e8f0;
    --ap-bg: #f7f8fc;
    --ap-org: #ff4d2e;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Poppins", sans-serif;
    color: var(--ap-ink);
    padding: 0 16px;
}
.ap-page * {
    box-sizing: border-box;
}

/* top bar */
.ap-top {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 190px 26px 16px;
}
.ap-page[dir="rtl"] .ap-top {
    padding: 26px 16px 26px 190px;
}
.ap-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}
.ap-logo img {
    height: 44px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}
.ap-logo span {
    font-size: 24px;
    font-weight: 600;
    color: #14112e;
    letter-spacing: 0.2px;
}
.ap-top-link {
    font-size: 13.5px;
    color: var(--ap-mute);
}
.ap-top-link a {
    color: var(--ap-p);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.ap-top-link a:hover {
    color: var(--ap-pd);
}

/* card */
.ap-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 18px auto 0;
    border-radius: 28px;
    border-top: 6px solid transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(90deg, #6c3cf5, #8b5cf6, #ff6b4a) border-box;
    padding: 40px 48px 34px;
    box-shadow:
        0 30px 80px rgba(40, 20, 120, 0.12),
        0 0 0 1px rgba(108, 60, 245, 0.06);
}
.ap-card--sm {
    max-width: 500px;
}

.ap-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ap-p);
    background: #f1edff;
    padding: 6px 12px;
    border-radius: 30px;
    margin-bottom: 14px;
}
.ap-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c58b;
}
.ap-title {
    font-size: 30px !important;
    font-weight: 700 !important;
    letter-spacing: -0.6px;
    margin: 0;
    color: var(--ap-ink);
}
.ap-sub {
    color: var(--ap-mute);
    font-size: 14.5px;
    margin: 6px 0 26px;
}
.ap-alerts:empty {
    display: none;
}
.ap-alerts .alert {
    border-radius: 14px;
    font-size: 13.5px;
}

/* fields */
.ap-row {
    display: flex;
    gap: 16px;
}
.ap-row > .ap-field {
    flex: 1;
    min-width: 0;
}
.ap-field {
    margin-bottom: 18px;
}
.ap-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #262a41;
    margin-bottom: 8px;
}
.ap-label .required::after,
.ap-label.required::after {
    content: "*";
    color: var(--ap-org);
    margin-left: 4px;
}
.ap-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ap-label-row .ap-label {
    margin-bottom: 0;
}
.ap-link {
    color: var(--ap-p) !important;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none !important;
}
.ap-opt {
    font-size: 12px;
    color: var(--ap-mute);
}

.ap-inp {
    position: relative;
}
.ap-ic {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    pointer-events: none;
    z-index: 3;
}
.ap-ic svg,
.ap-secure svg,
.ap-btn svg {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ap-ic svg {
    width: 18px;
    height: 18px;
    stroke: #8d92a8;
    stroke-width: 1.8;
}
.ap-page[dir="rtl"] .ap-ic {
    left: auto;
    right: 16px;
}

.ap-page .form-control {
    height: 52px;
    border-radius: 14px !important;
    border: 1.5px solid var(--ap-line) !important;
    background: var(--ap-bg) !important;
    font-size: 14px;
    color: #1b1f33;
    box-shadow: none !important;
    transition: 0.2s;
}
.ap-inp .form-control {
    padding: 0 48px 0 46px !important;
}
.ap-page[dir="rtl"] .ap-inp .form-control {
    padding: 0 46px 0 48px !important;
}
.ap-page .form-control::placeholder {
    color: #9a9fb3;
}
.ap-page .form-control:focus {
    border-color: var(--ap-p) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(108, 60, 245, 0.12) !important;
}
.ap-eye {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    color: #8d92a8;
    font-size: 16px;
}
.ap-page[dir="rtl"] .ap-eye {
    right: auto;
    left: 16px;
}
.ap-eye:hover {
    color: var(--ap-p);
}

/* phone (intl-tel-input) */
.ap-phone .iti {
    width: 100%;
    display: block;
}
.ap-phone .form-control {
    width: 100%;
}
.ap-phone .iti__selected-flag {
    border-radius: 14px 0 0 14px;
    padding: 0 10px 0 16px;
}

/* checkbox */
.ap-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 0 !important;
    margin: 4px 0 18px;
    font-size: 13.5px;
    color: #3a3f57;
}
.ap-check .form-check-input {
    float: none;
    margin: 0 !important;
    width: 20px;
    height: 20px;
    flex: none;
    cursor: pointer;
    border: 1.5px solid #c9cce0;
    border-radius: 6px !important;
}
.ap-check .form-check-input:checked {
    background-color: var(--ap-p);
    border-color: var(--ap-p);
}
.ap-check .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(108, 60, 245, 0.12);
}
.ap-check .form-check-label {
    cursor: pointer;
    line-height: 1.5;
}
.ap-check a {
    color: var(--ap-p);
    font-weight: 500;
    text-decoration: none;
}

.ap-captcha {
    margin: 0 0 6px;
}

/* buttons */
.ap-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 18px;
    background: linear-gradient(90deg, #6c3cf5, #8b5cf6);
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    font-size: 15.5px;
    box-shadow: 0 14px 30px rgba(108, 60, 245, 0.35);
    transition: 0.2s;
}
.ap-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(108, 60, 245, 0.42);
    color: #fff;
}
.ap-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    stroke-width: 2.2;
}

.ap-btn2 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    border-radius: 14px;
    border: 1.5px solid var(--ap-line);
    background: #fff;
    font-weight: 600;
    font-size: 14.5px;
    color: #262a41 !important;
    text-decoration: none !important;
    transition: 0.2s;
}
.ap-btn2:hover {
    border-color: var(--ap-p);
    background: #faf8ff;
}
.ap-btn2 b {
    color: var(--ap-p);
}
.ap-btn2 .ap-g {
    width: 20px;
    height: 20px;
}
.ap-btn2--mt {
    margin-top: 10px;
}
.ap-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.ap-or {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #9a9fb3;
    font-size: 12.5px;
    margin: 24px 0 16px;
}
.ap-or::before,
.ap-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ap-line);
}

.ap-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 12px;
    color: #8d92a8;
}
.ap-secure svg {
    width: 14px;
    height: 14px;
    stroke: #34b37e;
    stroke-width: 2;
}

/* footer */
.ap-foot {
    padding: 26px 0 30px;
    font-size: 12.5px;
    color: #9a9fb3;
    text-align: center;
}
.ap-foot a {
    color: #262a41;
    font-weight: 600;
    text-decoration: none;
}

/* ---------- fit in one screen (no scroll on desktop) ---------- */
body:has(.ap-page) .authImage > ul {
    display: none;
}
.ap-page {
    height: 100vh;
    min-height: 0;
    justify-content: space-between;
}
.ap-top {
    max-width: none;
    padding: 18px 190px 0 40px;
    flex: none;
}
.ap-page[dir="rtl"] .ap-top {
    padding: 18px 40px 0 190px;
}
body:has(.ap-page) .authImage > .dropdown {
    top: 16px;
}
.ap-logo img {
    height: 38px;
}
.ap-logo span {
    font-size: 22px;
}
.ap-card {
    margin: auto;
    max-width: 760px;
    padding: 26px 40px 22px;
    border-radius: 24px;
}
.ap-card--sm {
    max-width: 480px;
}
.ap-badge {
    margin-bottom: 8px;
    padding: 5px 11px;
    font-size: 11px;
}
.ap-title {
    font-size: 26px !important;
}
.ap-sub {
    margin: 2px 0 16px;
    font-size: 13.5px;
}
.ap-field {
    margin-bottom: 12px;
}
.ap-label {
    margin-bottom: 6px;
    font-size: 12.5px;
}
.ap-label-row {
    margin-bottom: 6px;
}
.ap-page .form-control {
    height: 46px;
}
.ap-check {
    margin: 2px 0 12px;
}
.ap-check .form-check-input {
    background-color: #fff;
}
.ap-check .form-check-input:checked {
    background-color: var(--ap-p);
}
.ap-btn {
    height: 48px;
    margin-top: 12px;
    font-size: 15px;
}
.ap-btn2 {
    height: 46px;
}
.ap-or {
    margin: 16px 0 12px;
}
.ap-secure {
    margin-top: 12px;
}
.ap-foot {
    padding: 10px 0 14px;
    flex: none;
}
.ap-captcha {
    margin-bottom: 4px;
}
.ap-submit {
    display: flex;
    align-items: center;
    gap: 20px;
}
.ap-submit .ap-captcha {
    margin: 0;
    flex: none;
}
.ap-submit .ap-btn {
    margin-top: 0;
    flex: 1;
}
@media (max-width: 767px) {
    .ap-submit {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
}
/* short screens (laptops): tighten more */
@media (min-width: 768px) and (max-height: 820px) {
    .ap-sub,
    .ap-secure {
        display: none;
    }
    .ap-badge {
        margin-bottom: 6px;
    }
    .ap-title {
        font-size: 23px !important;
        margin-bottom: 12px;
    }
    .ap-card {
        padding: 20px 36px 18px;
    }
    .ap-field {
        margin-bottom: 10px;
    }
    .ap-page .form-control {
        height: 42px;
    }
    .ap-btn {
        height: 44px;
        margin-top: 8px;
    }
    .ap-btn2 {
        height: 42px;
    }
    .ap-or {
        margin: 12px 0 10px;
    }
    .ap-badge {
        display: none;
    }
}
/* phones & very short screens: allow normal scrolling */
@media (max-width: 767px), (max-height: 640px) {
    .ap-page {
        height: auto;
        min-height: 100vh;
    }
    .ap-card {
        margin: 14px auto 0;
    }
}

/* ---------- tablet / mobile ---------- */
@media (max-width: 767px) {
    .ap-top {
        flex-wrap: wrap;
        padding: 20px 150px 8px 4px;
    }
    .ap-page[dir="rtl"] .ap-top {
        padding: 20px 4px 8px 150px;
    }
    .ap-top-link {
        width: 100%;
        order: 3;
    }
    body:has(.ap-page) .authImage > .dropdown {
        top: 20px;
        right: 16px;
    }
    body:has(.ap-page) .authImage.rtl > .dropdown {
        left: 16px;
    }
    .ap-logo img {
        height: 36px;
    }
    .ap-logo span {
        font-size: 20px;
    }
}
@media (max-width: 575px) {
    .ap-card {
        padding: 30px 20px 26px;
        border-radius: 22px;
    }
    .ap-row {
        flex-direction: column;
        gap: 0;
    }
    .ap-title {
        font-size: 25px !important;
    }
}
