/* =========================================================
   Authentication pages (web / user scope)
   Bootstrap 5 based, driven by the dynamic theme CSS variables
   injected via resources/views/web/layouts/partials/theme-vars.blade.php

   Available variables:
   --primary-color, --secondary-color, --body-bg, --text-color,
   --link-color, --footer-bg

   Works in both LTR and RTL (bootstrap.rtl.min.css) - logical
   Bootstrap utilities (start-*/end-*) are used instead of left/right,
   and no rule below depends on document direction.
   ========================================================= */

/* Brand-color utilities usable anywhere on an auth page, including
   outside the .auth-web-section wrapper (e.g. supporting info cards
   placed below a wide registration form). */
.auth-brand-text {
    color: var(--primary-color, #39004D) !important;
}

.auth-brand-bg {
    background-color: var(--primary-color, #39004D) !important;
}

.auth-info-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.auth-info-card .list-unstyled li {
    color: var(--text-color, #212529);
}

/* ---------------------------------------------------------
   Page background - soft brand-tinted wash behind the card
   --------------------------------------------------------- */
.auth-web-section {
    position: relative;
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    background-color: var(--body-bg, #F5FBFF);
    overflow: hidden;
}

.auth-web-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--primary-color, #39004D) 14%, transparent) 0%, transparent 50%),
        radial-gradient(circle at 88% 90%, color-mix(in srgb, var(--secondary-color, #6C757D) 12%, transparent) 0%, transparent 50%);
    pointer-events: none;
}

.auth-web-section .container {
    position: relative;
    z-index: 1;
}

/* Brand mark above the card */
.auth-web-brand .auth-web-logo {
    max-height: 46px;
    width: auto;
}

/* ---------------------------------------------------------
   Card
   --------------------------------------------------------- */
.auth-web-section .auth-card {
    position: relative;
    width: 100%;
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(20, 10, 40, 0.1);
    overflow: hidden;
    background-color: #fff;
}

.auth-web-section .auth-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color, #39004D), color-mix(in srgb, var(--primary-color, #39004D) 40%, var(--secondary-color, #6C757D)));
}

.auth-web-section .auth-card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 2.25rem 2rem 1.25rem;
    text-align: center;
}

.auth-web-section .auth-card-title {
    color: var(--text-color, #212529);
    font-weight: 700;
    margin-bottom: 0;
}

.auth-web-section .auth-card-subtitle {
    color: var(--secondary-color, #6C757D);
    font-size: 0.925rem;
    margin: 0.5rem 0 0;
}

.auth-web-section .auth-card-body {
    padding: 2rem;
}

/* ---------------------------------------------------------
   Form controls - single, consistent pattern app-wide:
   label above field, clean rounded inputs, no floating labels.
   --------------------------------------------------------- */
.auth-web-section .form-label {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--text-color, #212529);
    margin-bottom: 0.4rem;
}

.auth-web-section .form-control,
.auth-web-section .form-select {
    border-radius: 12px;
    border: 1px solid #E1E5EA;
    padding: 0.7rem 1rem;
    background-color: #fff;
    font-size: 0.95rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.auth-web-section .form-control:focus,
.auth-web-section .form-select:focus {
    border-color: var(--primary-color, #39004D);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color, #39004D) 18%, transparent);
}

.auth-web-section .form-control.is-invalid,
.auth-web-section .form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.auth-web-section .invalid-feedback {
    font-size: 0.825rem;
}

.auth-web-section .form-check-input:checked {
    background-color: var(--primary-color, #39004D);
    border-color: var(--primary-color, #39004D);
}

.auth-web-section .form-check-input:focus {
    border-color: var(--primary-color, #39004D);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color, #39004D) 20%, transparent);
}

/* Optional left-icon adornment used on a few single-line fields
   (e.g. login, forgot password). Logical start/end so it mirrors in RTL. */
.auth-web-section .auth-field-icon {
    position: relative;
}

.auth-web-section .auth-field-icon .auth-field-icon-glyph {
    position: absolute;
    top: 50%;
    inset-inline-start: 1rem;
    transform: translateY(-50%);
    color: var(--secondary-color, #6C757D);
    pointer-events: none;
}

.auth-web-section .auth-field-icon .form-control {
    padding-inline-start: 2.75rem;
}

/* Buttons */
.auth-web-section .btn-primary,
.auth-web-section .btn-base {
    background-color: var(--primary-color, #39004D);
    border-color: var(--primary-color, #39004D);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #fff;
    transition: filter .15s ease-in-out, transform .15s ease-in-out, box-shadow .15s ease-in-out;
}

.auth-web-section .btn-primary:hover,
.auth-web-section .btn-primary:focus,
.auth-web-section .btn-base:hover,
.auth-web-section .btn-base:focus {
    filter: brightness(0.92);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color, #39004D) 30%, transparent);
}

/* Links */
.auth-web-section a {
    color: var(--link-color, #39004D);
    font-weight: 600;
}

.auth-web-section a:hover {
    text-decoration: underline;
}

.auth-web-section .auth-card-footer-text {
    color: var(--text-color, #212529);
    font-weight: 400;
}

/* Small helper / exists text under fields */
.auth-web-section small.text-danger {
    display: block;
    margin-top: 0.25rem;
}

/* ---------------------------------------------------------
   Entrance animation - card fades/slides in on page load
   --------------------------------------------------------- */
@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-web-section .auth-card-animate {
    animation: authCardIn .55s cubic-bezier(.16, 1, .3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .auth-web-section .auth-card-animate {
        animation: none;
    }
}

/* ---------------------------------------------------------
   Decorative animated blobs (used when illustration isn't
   shown, e.g. narrow forgot-password/OTP/reset screens)
   --------------------------------------------------------- */
.auth-web-section .auth-bg-decor {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-web-section .auth-bg-blob {
    position: absolute;
    width: 420px;
    height: 420px;
    opacity: 0.14;
}

.auth-web-section .auth-bg-blob-1 {
    top: -120px;
    inset-inline-start: -140px;
    animation: authBlobFloat 10s ease-in-out infinite;
}

.auth-web-section .auth-bg-blob-2 {
    bottom: -140px;
    inset-inline-end: -120px;
    animation: authBlobFloat 12s ease-in-out infinite reverse;
}

@keyframes authBlobFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(18px, -22px) rotate(8deg);
    }
}

/* ---------------------------------------------------------
   Split layout - illustration column beside the auth card
   (login / register). Illustration hides below lg so the
   form stays full-width and unobstructed on mobile.
   --------------------------------------------------------- */
.auth-web-section-split .container {
    max-width: 1200px;
}

.auth-illustration-col {
    position: relative;
    z-index: 1;
}

.auth-illustration-wrap {
    max-width: 420px;
    margin-inline: auto;
    animation: authIllustrationIn .6s cubic-bezier(.16, 1, .3, 1) both;
}

.auth-illustration-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

@keyframes authIllustrationIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-illust-float {
    transform-box: fill-box;
    transform-origin: center;
    animation: authIllustFloat 4s ease-in-out infinite;
}

.auth-illust-float-slow {
    transform-box: fill-box;
    transform-origin: center;
    animation: authIllustFloat 5.5s ease-in-out infinite;
    animation-delay: .3s;
}

.auth-illust-float-fast {
    transform-box: fill-box;
    transform-origin: center;
    animation: authIllustFloat 3.2s ease-in-out infinite;
    animation-delay: .6s;
}

@keyframes authIllustFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@media (prefers-reduced-motion: reduce) {

    .auth-web-section .auth-bg-blob,
    .auth-illustration-wrap,
    .auth-illust-float,
    .auth-illust-float-slow,
    .auth-illust-float-fast {
        animation: none;
    }
}

/* ---------------------------------------------------------
   Verification code input (see partials/verification_code.blade.php)
   Single input styled to read as evenly spaced digit boxes, so the
   existing name/id/JS keep working untouched.
   --------------------------------------------------------- */
.auth-web-section .otp-input {
    --otp-digits: 6;
    max-width: 22rem;
    margin-inline: auto;
    display: block;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.75rem;
    padding-block: 0.85rem;
    padding-inline-start: calc(0.75rem + 0.375rem);
    background-image: repeating-linear-gradient(90deg,
            #E1E5EA 0,
            #E1E5EA 2px,
            transparent 2px,
            transparent calc(100% / var(--otp-digits)));
    background-size: calc(100% / var(--otp-digits) * (var(--otp-digits) - 1)) 1px;
    background-repeat: no-repeat;
    background-position: left center;
}

.auth-web-section .otp-input:focus {
    letter-spacing: 0.75rem;
}

.auth-web-section .verification-text {
    text-align: center;
    color: var(--secondary-color, #6C757D);
}

/* Responsive - matches site's existing breakpoints (1199 / 991 / 767 / 575) */
@media (max-width: 1199px) {
    .auth-web-section .auth-card-body {
        padding: 1.75rem;
    }
}

@media (max-width: 991px) {
    .auth-web-section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
}

@media (max-width: 767px) {
    .auth-web-section .auth-card-header {
        padding: 1.75rem 1.5rem 1rem;
    }

    .auth-web-section .auth-card-body {
        padding: 1.5rem;
    }

    .auth-web-section .auth-card-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 575px) {
    .auth-web-section {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }

    .auth-web-brand .auth-web-logo {
        max-height: 38px;
    }

    .auth-web-section .auth-card {
        border-radius: 14px;
    }

    .auth-web-section .auth-card-header,
    .auth-web-section .auth-card-body {
        padding: 1.15rem;
    }

    .auth-web-section .btn-primary,
    .auth-web-section .btn-base {
        padding: 0.7rem 0.9rem;
    }

    .auth-web-section .otp-input {
        font-size: 1.2rem;
        letter-spacing: 0.5rem;
    }

    /* Prevent input-groups (e.g. file-upload attachments in the
       registration forms) from overflowing the card on very small screens. */
    .auth-web-section .input-group {
        flex-wrap: wrap;
    }

    .auth-web-section .input-group > .form-control,
    .auth-web-section .input-group > .input-group-text {
        width: 100%;
        border-radius: 10px !important;
    }
}
