/* =====================================================================
   ItineraryCrafter — Páginas de autenticación (auth.css)
   Requiere site.css. Layout: templates/auth/_layout.html
   ===================================================================== */

.auth {
    min-height: 100vh;
    background: #fff;
    color: var(--text);
}

.auth a {
    color: var(--blue-700);
    text-decoration: none;
}

.auth a:hover {
    color: var(--ink-900);
    text-decoration: underline;
}

.auth__shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    min-height: 100vh;
}

/* ---------------- Columna del formulario ---------------- */

.auth__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 26px clamp(20px, 5vw, 64px) 22px;
    background:
        radial-gradient(700px 360px at 0% 0%, rgba(92, 151, 255, 0.1), transparent 70%),
        #fff;
}

.auth__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-900) !important;
    text-decoration: none !important;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.auth-brand b {
    font-weight: 600;
    color: var(--blue-600);
}

.auth__top-link {
    margin: 0;
    font-size: 14.5px;
    color: var(--text-3);
}

.auth__top-link a {
    font-weight: 600;
}

.auth__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card--wide {
    max-width: 620px;
}

.auth-card--center {
    text-align: center;
    max-width: 520px;
}

.auth-card h1 {
    margin: 0 0 10px;
    font-family: var(--font-serif);
    font-size: clamp(32px, 3.4vw, 42px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: var(--ink-900);
}

.auth-card h1::before {
    content: "";
    display: block;
    width: 26px;
    height: 3px;
    margin-bottom: 18px;
    border-radius: 2px;
    background: var(--sand-500);
}

.auth-card--center h1::before {
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    margin: 0 0 26px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-2);
}

.auth-card--center p {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-2);
}

.actions {
    margin-top: 26px;
}

.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    background: var(--blue-600);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px -12px rgba(10, 99, 232, 0.8);
    transition: background-color 0.2s ease;
}

.actions a:hover {
    background: var(--blue-700);
}

/* ---------------- Mensajes ---------------- */

.alert,
.status {
    border-radius: 12px;
    padding: 13px 16px;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.55;
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #F3C9C5;
}

.alert.success,
.status.success {
    background: var(--success-bg);
    color: var(--success);
    border-color: #C7E6CF;
}

.status {
    margin: 18px 0 0;
    text-align: center;
}

/* ---------------- Campos ---------------- */

label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--n-800);
}

.field {
    margin-bottom: 18px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--n-200);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--text);
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card input::placeholder {
    color: var(--n-400);
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(47, 123, 255, 0.16);
}

.auth-card input.code-input {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 22px;
    letter-spacing: 0.35em;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px !important;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    padding: 6px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--n-400);
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.password-toggle:hover {
    color: var(--n-700);
    background: var(--n-100);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-counter {
    margin-top: 8px;
    font-size: 13px;
    color: var(--n-400);
    transition: color 0.3s ease;
}

.password-counter.met {
    color: var(--success);
}

.counter-current {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------------- Botones ---------------- */

.button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--blue-600);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px -12px rgba(10, 99, 232, 0.85);
    transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.button:hover {
    background: var(--blue-700);
}

.button:active {
    transform: translateY(1px);
}

.secondary-form {
    margin-top: 12px;
}

.secondary-button {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--n-200);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-900);
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.secondary-button:hover {
    background: var(--n-50);
    border-color: var(--n-300);
}

.links {
    margin-top: 20px;
    display: grid;
    gap: 10px;
    font-size: 15px;
    text-align: center;
}

.links a {
    font-weight: 600;
}

.links-secondary {
    margin-top: 10px;
    font-size: 14px;
}

.links-secondary a {
    font-weight: 500;
    color: var(--text-3);
}

.links-secondary a:hover {
    color: var(--blue-700);
}

/* ---------------- Registro ---------------- */

.access-highlights {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -10px 0 26px;
    padding: 0;
}

.access-highlights li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--blue-700);
    background: var(--blue-50);
    border: 1px solid var(--blue-100);
}

.access-highlights li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue-500);
}

.register-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
}

.register-form > .field-full,
.register-form > .auth-register-terms-field,
.register-form > .button {
    grid-column: 1 / -1;
}

.label-with-tip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
}

.label-with-tip label {
    margin-bottom: 0;
}

.help-icon-wrapper {
    display: inline-flex;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid var(--n-400);
    background: none;
    color: var(--n-500);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}

.help-icon:hover,
.help-icon:focus {
    color: var(--blue-600);
    border-color: var(--blue-600);
    outline: none;
}

.help-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 100;
    width: 270px;
    max-width: calc(100vw - 40px);
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--ink-900);
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.help-icon-wrapper:hover .help-tooltip,
.help-icon:focus + .help-tooltip {
    opacity: 1;
}

.auth-register-terms-field {
    margin: -2px 0 20px;
}

.auth-register-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--n-150);
    border-radius: 12px;
    background: var(--n-50);
}

.auth-register-terms-field.has-error .auth-register-terms-row {
    border-color: #F3C9C5;
    background: var(--danger-bg);
}

.auth-register-terms-checkbox {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--blue-600);
}

.auth-register-terms-label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    color: var(--n-600);
}

.auth-register-terms-label a {
    font-weight: 600;
}

.auth-register-terms-error {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--danger);
}

/* ---------------- Pie ---------------- */

.auth__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    padding-top: 18px;
    border-top: 1px solid var(--n-150);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-3);
}

.auth__footer p {
    margin: 0;
}

.auth__legal {
    display: flex;
    gap: 16px;
}

.auth__legal a {
    color: var(--text-3);
}

/* ---------------- Panel de marca ---------------- */

.auth__aside {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: clamp(40px, 5vw, 64px);
    background: var(--ink-900);
    color: #fff;
}

.auth-aside__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(520px 380px at 80% 85%, rgba(47, 123, 255, 0.42), transparent 70%),
        radial-gradient(420px 300px at 10% 10%, rgba(212, 178, 122, 0.12), transparent 70%),
        radial-gradient(rgba(150, 180, 235, 0.16) 1px, transparent 1.4px) 0 0 / 18px 18px;
}

.auth-aside__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 20, 31, 0.2), rgba(8, 20, 31, 0) 40%, rgba(8, 20, 31, 0.5));
}

.auth-aside__inner {
    max-width: 460px;
}

.auth-aside__kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--blue-300);
}

.auth-aside__kicker::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--sand-400);
}

.auth-aside__title {
    margin: 0;
    font-size: clamp(30px, 3vw, 44px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: #fff;
}

.auth-aside__title em {
    font-family: var(--font-serif);
    font-size: 1.06em;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--blue-300);
}

.auth-aside__list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
}

.auth-aside__list li {
    position: relative;
    padding-left: 30px;
    font-size: 15.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.76);
}

.auth-aside__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(92, 151, 255, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238AB6FF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.auth-aside__visual {
    position: relative;
    height: 280px;
    max-width: 480px;
}

.aside-doc {
    position: absolute;
    left: 6%;
    bottom: 0;
    width: 64%;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    font-family: var(--doc-sans);
    color: var(--doc-ink);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
    transform: rotate(-3deg);
}

.aside-doc__band {
    display: grid;
    gap: 6px;
    padding: 16px 18px 12px;
    background: var(--doc-paper);
}

.aside-doc__kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.aside-doc__kicker i {
    width: 16px;
    height: 2px;
    background: var(--doc-ink);
}

.aside-doc__title {
    margin: 4px 0 6px;
    font-family: var(--font-serif);
    font-size: 26px;
    line-height: 1.05;
}

.aside-doc__row {
    display: grid;
    grid-template-columns: 56px 1fr;
    padding-top: 5px;
    border-top: 1px solid var(--doc-line);
    font-size: 11px;
    font-weight: 600;
    color: var(--doc-text);
}

.aside-doc__row small {
    font-size: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--doc-muted);
}

.aside-doc__body {
    display: grid;
    gap: 8px;
    padding: 14px 18px 18px;
}

.aside-doc__route {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    font-size: 14px;
}

.aside-doc__route i {
    flex: 1;
    height: 1.5px;
    background: var(--doc-accent);
}

.aside-doc__line {
    height: 6px;
    border-radius: 3px;
    background: var(--doc-line);
}

.aside-doc__line--short {
    width: 64%;
}

.aside-chip {
    position: absolute;
    display: grid;
    gap: 2px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(13, 30, 46, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.aside-chip small {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.55);
}

.aside-chip--flight {
    right: 4%;
    top: 4%;
    grid-template-columns: auto auto;
    column-gap: 12px;
    align-items: baseline;
}

.aside-chip--flight b {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--blue-200);
}

.aside-chip--flight span {
    font-size: 14px;
    font-weight: 600;
}

.aside-chip--flight small {
    grid-column: 1 / -1;
}

.aside-chip--total {
    right: 0;
    bottom: 12%;
}

.aside-chip--total b {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 400;
    line-height: 1.1;
    color: #fff;
}

.aside-chip--total em {
    font-family: var(--font-sans);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--blue-200);
}

@media (prefers-reduced-motion: no-preference) {
    .aside-doc {
        animation: aside-float 9s ease-in-out infinite alternate;
    }

    .aside-chip--flight {
        animation: aside-float 7s ease-in-out -2s infinite alternate;
    }

    .aside-chip--total {
        animation: aside-float 8s ease-in-out -4s infinite alternate;
    }

    .auth-card {
        animation: auth-in 0.8s var(--ease-out) both;
    }
}

@keyframes aside-float {
    to {
        translate: 0 -10px;
    }
}

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

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1000px) {
    .auth__shell {
        grid-template-columns: 1fr;
    }

    .auth__aside {
        display: none;
    }
}

@media (max-width: 700px) {
    .register-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .auth__main {
        padding: 18px 18px 18px;
    }

    .auth__content {
        padding: 28px 0 36px;
        align-items: flex-start;
    }

    .auth__top-link {
        font-size: 13.5px;
    }

    .help-tooltip {
        left: 0;
        right: 0;
        width: auto;
    }

    .auth__footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
