/* ==========================================================================
   Tripaure — auth screens (login, register, forgot/reset, verify email)
   Split card: form on the start side, branded photo panel on the end side.
   Loaded after tripaure-pages.css; reuses its form tokens.
   ========================================================================== */

/* §  SHELL */

.tp-auth {
    position: relative;
    padding: 1.5rem 0 3rem;
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(var(--tp-accent-rgb), .12), transparent 60%),
        radial-gradient(700px 380px at 100% 100%, rgba(var(--tp-primary-rgb), .08), transparent 60%),
        var(--tp-bg-soft);
    overflow: hidden;
}

.tp-auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
    max-width: 1040px;
    min-height: 560px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-lg);
    box-shadow: 0 30px 80px -20px rgba(var(--tp-text-dark-rgb), .18);
    overflow: hidden;
    animation: tp-auth-in .5s ease both;
}

.tp-auth-card--wide {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
    max-width: 1160px;
}

@keyframes tp-auth-in {
    from { opacity: 0; transform: translateY(14px); }
}

.tp-auth-main {
    padding: 2rem clamp(1.5rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.tp-auth-main > * {
    width: 100%;
    max-width: 440px;
}

.tp-auth-card--wide .tp-auth-main > * {
    max-width: 580px;
}

/* §  HEAD */

.tp-auth-head {
    margin-bottom: 1.25rem;
}

.tp-auth-icon {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, var(--tp-accent), var(--tp-primary));
    box-shadow: 0 10px 24px -6px rgba(var(--tp-primary-rgb), .55);
}

.tp-auth-title {
    font-family: var(--tp-font-heading);
    font-size: clamp(1.4rem, 2.2vw, 1.75rem);
    font-weight: 700;
    color: var(--tp-text-dark);
    margin: 0 0 .25rem;
    display: flex;
    align-items: center;
    gap: .8rem;
}

.tp-auth-sub {
    color: var(--tp-text-muted);
    margin: 0;
}

.tp-auth-sub a {
    font-weight: 600;
    color: var(--tp-accent-deep);
    text-decoration: none;
}

.tp-auth-sub a:hover {
    text-decoration: underline;
}

/* §  FIELDS */

/* Denser than the site-wide form defaults so register fits one screen. */
.tp-auth .tp-form-grid {
    gap: .85rem 1rem;
}

.tp-auth .tp-label {
    margin-bottom: .3rem;
}

.tp-auth .tp-input,
.tp-auth .tp-select.ts-wrapper .ts-control {
    padding-block: .62rem;
}

.tp-auth-field {
    margin-bottom: .9rem;
}

.tp-auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}

.tp-auth-label-row a {
    font-size: .82rem;
    font-weight: 600;
    color: var(--tp-accent-deep);
    text-decoration: none;
}

.tp-auth-label-row a:hover {
    text-decoration: underline;
}

.tp-auth-optional {
    font-weight: 400;
    color: var(--tp-text-muted);
}

/* Icon-prefixed input; the inline-start icon and reveal button sit over the field. */
.tp-auth-input {
    position: relative;
}

.tp-auth-input > i {
    position: absolute;
    inset-inline-start: .9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--tp-text-muted);
    pointer-events: none;
    transition: color .2s ease;
}

.tp-auth-input:focus-within > i {
    color: var(--tp-accent-deep);
}

.tp-auth-input .tp-input {
    padding-inline-start: 2.6rem;
}

.tp-auth-input .tp-input[type="password"],
.tp-auth-input .tp-input[data-revealed] {
    padding-inline-end: 2.9rem;
}

/* Inputs are dir="ltr", so their logical padding flips away from the icon in
   RTL — pin it physically to the page's start (right) side instead. */
[dir="rtl"] .tp-auth-input .tp-input {
    text-align: right;
    padding-left: .9rem;
    padding-right: 2.6rem;
}

[dir="rtl"] .tp-auth-input .tp-input[type="password"],
[dir="rtl"] .tp-auth-input .tp-input[data-revealed] {
    padding-left: 2.9rem;
}

.tp-auth-reveal {
    position: absolute;
    inset-inline-end: .35rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--tp-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.tp-auth-reveal:hover,
.tp-auth-reveal:focus-visible {
    color: var(--tp-accent-deep);
    background: rgba(var(--tp-accent-rgb), .1);
    outline: 0;
}

.tp-auth-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: .1rem 0 1.1rem;
    font-size: .9rem;
    color: var(--tp-text-dark);
    cursor: pointer;
}

.tp-auth-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--tp-accent-deep);
}

/* §  PASSWORD STRENGTH / MATCH */

.tp-auth-strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    align-items: center;
    gap: 5px;
    margin-top: .5rem;
}

.tp-auth-strength span {
    height: 4px;
    border-radius: 4px;
    background: var(--tp-border);
    transition: background .25s ease;
}

.tp-auth-strength em {
    min-width: 4.5em;
    font-size: .75rem;
    font-style: normal;
    font-weight: 600;
    text-align: end;
    color: var(--tp-text-muted);
}

.tp-auth-strength[data-score="1"] span:nth-child(-n+1) { background: #e5484d; }
.tp-auth-strength[data-score="2"] span:nth-child(-n+2) { background: #f5a524; }
.tp-auth-strength[data-score="3"] span:nth-child(-n+3) { background: var(--tp-accent); }
.tp-auth-strength[data-score="4"] span:nth-child(-n+4) { background: var(--color-success); }

.tp-auth-match {
    display: block;
    margin-top: .4rem;
    font-size: .8rem;
    color: #d64545;
}

.tp-auth-match.is-ok {
    color: var(--color-success);
}

/* §  BUTTONS */

.tp-auth-submit {
    padding-block: .75rem;
    font-size: 1rem;
    gap: .4rem;
}

.tp-form-grid + .tp-auth-submit {
    margin-top: 1.25rem;
}

/* Match the other register fields' height. */
.tp-auth .tp-select.ts-wrapper .ts-control {
    min-height: 46px;
    align-items: center;
}

.tp-auth-submit i {
    font-size: 1.25rem;
    transition: transform .2s ease;
}

.tp-auth-submit:hover i {
    transform: translateX(3px);
}

[dir="rtl"] .tp-auth-submit:hover i {
    transform: translateX(-3px);
}

/* Spinner while the form posts (class set by tripaure-auth.js / tripaure-web.js). */
.tp-auth-submit.tp-btn-loading {
    color: transparent;
    position: relative;
}

.tp-auth-submit.tp-btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tp-auth-spin .7s linear infinite;
}

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

.tp-auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    width: 100%;
    padding: .65rem 1rem;
    font-weight: 600;
    color: var(--tp-text-dark);
    background: #fff;
    border: 1.5px solid var(--tp-border);
    border-radius: var(--tp-radius-btn);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.tp-auth-google:hover {
    color: var(--tp-text-dark);
    border-color: rgba(var(--tp-accent-rgb), .6);
    box-shadow: 0 8px 20px -8px rgba(var(--tp-text-dark-rgb), .25);
    transform: translateY(-1px);
}

.tp-auth-or {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 1rem 0;
    font-size: .8rem;
    color: var(--tp-text-muted);
}

.tp-auth-or::before,
.tp-auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--tp-border);
}

.tp-auth-linkbtn {
    padding: 0;
    border: 0;
    background: none;
    font-weight: 600;
    color: var(--tp-accent-deep);
    cursor: pointer;
}

.tp-auth-linkbtn:hover:not(:disabled) {
    text-decoration: underline;
}

.tp-auth-linkbtn:disabled {
    color: var(--tp-text-muted);
    cursor: default;
}

/* §  FOOTNOTES */

.tp-auth-foot {
    margin-top: 1.1rem;
    text-align: center;
    font-size: .9rem;
    color: var(--tp-text-muted);
}

.tp-auth-foot a {
    font-weight: 600;
    color: var(--tp-accent-deep);
    text-decoration: none;
}

.tp-auth-foot a:hover {
    text-decoration: underline;
}

.tp-auth-back {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.tp-auth-legal {
    margin: .75rem 0 0;
    font-size: .8rem;
    text-align: center;
    color: var(--tp-text-muted);
}

.tp-auth-legal a {
    color: inherit;
    text-decoration: underline;
}

/* Identity chip — whose email the OTP / reset applies to. */
.tp-auth-who {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.4rem;
    padding: .7rem .9rem;
    font-weight: 600;
    color: var(--tp-text-dark);
    background: var(--tp-accent-light);
    border: 1px solid rgba(var(--tp-accent-rgb), .25);
    border-radius: var(--tp-radius-btn);
    overflow-wrap: anywhere;
}

.tp-auth-who i {
    font-size: 1.2rem;
    color: var(--tp-accent-deep);
}

.tp-auth-tips {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.tp-auth-tips li {
    display: flex;
    gap: .6rem;
    padding: .55rem 0;
    font-size: .9rem;
    color: var(--tp-text-muted);
}

.tp-auth-tips i {
    font-size: 1.15rem;
    color: var(--tp-accent-deep);
}

/* §  OTP */

.tp-auth-code {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: .5em;
}

.tp-otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .6rem;
}

.tp-otp input {
    width: 100%;
    aspect-ratio: 1 / 1.15;
    max-height: 64px;
    padding: 0;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--tp-text-dark);
    background: var(--tp-bg-soft);
    border: 1.5px solid var(--tp-border);
    border-radius: 12px;
    caret-color: var(--tp-accent-deep);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}

.tp-otp input:focus {
    outline: 0;
    background: #fff;
    border-color: var(--tp-accent);
    box-shadow: 0 0 0 4px rgba(var(--tp-accent-rgb), .15);
    transform: translateY(-2px);
}

.tp-otp input.is-filled {
    background: #fff;
    border-color: rgba(var(--tp-accent-rgb), .6);
}

.tp-otp.is-invalid input {
    border-color: #d64545;
    animation: tp-auth-shake .4s ease;
}

@keyframes tp-auth-shake {
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.tp-auth-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin: 1.1rem 0 1.4rem;
    font-size: .88rem;
    color: var(--tp-text-muted);
}

.tp-auth-timer strong {
    color: var(--tp-text-dark);
    font-variant-numeric: tabular-nums;
}

.tp-auth-timer.is-expired {
    color: #d64545;
}

/* §  ASIDE (brand panel) */

.tp-auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 2rem;
    color: #fff;
    background:
        radial-gradient(500px 300px at 90% 10%, rgba(var(--tp-accent-rgb), .55), transparent 65%),
        linear-gradient(160deg, var(--tp-primary) 0%, var(--tp-primary-deep) 75%);
    isolation: isolate;
}

/* Dark enough at the top for the white Jordan map and borders to read over any photo. */
.tp-auth-aside.has-img {
    background:
        linear-gradient(180deg,
            rgba(var(--tp-primary-deep-rgb), .72) 0%,
            rgba(var(--tp-primary-deep-rgb), .8) 45%,
            rgba(var(--tp-primary-deep-rgb), .94) 78%),
        var(--tp-auth-img) center / cover no-repeat;
}

/* Faint dotted "map" texture over either background. */
.tp-auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(180deg, #000, transparent 60%);
}

/* Fills the panel's upper space; flexes so short cards just shrink it. */
.tp-auth-map {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    margin: -2rem -2rem 0;
    container-type: size;
    overflow: hidden;
    mask-image: linear-gradient(180deg, #000 75%, transparent);
}

/* 3:2 box = the SVG viewBox (so % pin coordinates line up), sized to cover the area. */
.tp-auth-map-inner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100cqw, 150cqh);
    aspect-ratio: 3 / 2;
    transform: translate(-50%, -50%);
}

.tp-auth-map-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.tp-map-land path {
    fill: rgba(255, 255, 255, .1);
    stroke: rgba(255, 255, 255, .28);
    stroke-width: 1;
    stroke-linejoin: round;
}

.tp-map-jo {
    fill: #fff;
    stroke: #fff;
    stroke-width: 2;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, .6)) drop-shadow(0 0 30px rgba(var(--tp-accent-rgb), .9));
}

/* Amman (lon 35.93, lat 31.95) in the SVG's projection — see _map.blade.php. */
.tp-auth-pin,
.tp-auth-dot {
    position: absolute;
    left: 47%;
    top: 55.1%;
}

/* Flag badge on a tapered stem whose tip touches Amman. */
.tp-auth-pin {
    width: 56px;
    height: 92px;
    transform: translate(-50%, -100%);
    animation: tp-auth-float 3s ease-in-out infinite;
}

.tp-auth-pin::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50px;
    bottom: 0;
    width: 14px;
    margin-left: -7px;
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, .35));
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.tp-auth-flag {
    position: relative;
    z-index: 1;
    display: block;
    width: 56px;
    height: 56px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.tp-auth-dot {
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: #ce1126;
    box-shadow: 0 0 0 2px #fff;
}

.tp-auth-dot::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .6);
    animation: tp-auth-ping 1.8s ease-out infinite;
}

@keyframes tp-auth-float {
    50% { transform: translate(-50%, calc(-100% - 6px)); }
}

@keyframes tp-auth-ping {
    from { transform: scale(.6); opacity: .9; }
    to   { transform: scale(3.2); opacity: 0; }
}


.tp-auth-eyebrow {
    display: inline-block;
    margin-bottom: .75rem;
    padding: .3rem .8rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.tp-auth-aside-title {
    font-family: var(--tp-font-heading);
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    margin: 0 0 1.4rem;
}

.tp-auth-perks {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.tp-auth-perks li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .3rem 0;
    font-size: .95rem;
    color: rgba(255, 255, 255, .9);
}

.tp-auth-perks i {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
}

.tp-auth-journey {
    position: relative;
    padding: 1rem 0;   /* no side padding: keeps the 1/6 and 5/6 icon centres exact */
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.tp-auth-journey ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Dashed line joining the three step icons (icon centres sit at 1/6 and 5/6). */
.tp-auth-journey::before {
    content: "";
    position: absolute;
    top: calc(1rem + 18px);
    left: 16.67%;
    right: 16.67%;
    border-top: 2px dashed rgba(255, 255, 255, .35);
}

.tp-auth-journey li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
}

.tp-auth-journey li > i {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    color: #fff;
    background: var(--tp-primary-deep);
    border: 1.5px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    z-index: 1;   /* the car passes behind each step */
    animation: tp-auth-step 4.5s ease-in-out infinite;
}

/* Reaches step 2 at 1.5s and step 3 at 3s, matching the step highlights,
   then waits hidden behind step 3 and restarts hidden behind step 1. */
.tp-auth-journey-car {
    position: absolute;
    top: calc(1rem + 18px);
    inset-inline-start: 16.67%;
    font-size: 1.25rem;
    line-height: 1;
    color: #fff;
    transform: translate(-50%, -60%);
    animation: tp-auth-drive 4.5s ease-in-out infinite;
}

[dir="rtl"] .tp-auth-journey-car {
    transform: translate(50%, -60%) scaleX(-1);
}

@keyframes tp-auth-drive {
    0%     { inset-inline-start: 16.67%; }
    33.33% { inset-inline-start: 50%; }
    66.67%, 100% { inset-inline-start: 83.33%; }
}

.tp-auth-journey li:nth-child(2) > i { animation-delay: 1.5s; }
.tp-auth-journey li:nth-child(3) > i { animation-delay: 3s; }

/* Each step lights up for a third of the cycle, in order. */
@keyframes tp-auth-step {
    0%, 30% {
        background: var(--tp-accent);
        border-color: #fff;
        box-shadow: 0 0 0 5px rgba(var(--tp-accent-rgb), .3);
        transform: scale(1.08);
    }
    36%, 100% {
        background: var(--tp-primary-deep);
        border-color: rgba(255, 255, 255, .35);
        box-shadow: none;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-auth-card,
    .tp-auth-journey li > i,
    .tp-auth-journey-car,
    .tp-auth-pin,
    .tp-auth-dot::after {
        animation: none;
    }
}

/* §  RESPONSIVE */

@media (max-width: 991.98px) {

    .tp-auth-card,
    .tp-auth-card--wide {
        grid-template-columns: minmax(0, 1fr);
        max-width: 620px;
        min-height: 0;
    }

    .tp-auth-aside {
        display: none;
    }
}

@media (max-width: 575.98px) {

    .tp-auth {
        padding: 1.5rem 0 3rem;
    }

    .tp-auth-main {
        padding: 2rem 1.25rem;
    }

    .tp-otp {
        gap: .4rem;
    }
}
