/* =========================================================
   DATA100 — Auth Module
   Aesthetic: editorial corporate, navy + ink, precise lines
   ========================================================= */

:root {
    --auth-ink: #0b1f3a;
    --auth-ink-soft: #1f3354;
    --auth-accent: #c8102e;
    --auth-line: #e5e9f0;
    --auth-line-strong: #c9d2e0;
    --auth-paper: #ffffff;
    --auth-mute: #6b7587;
    --auth-bg: #f4f6fa;
    --auth-shadow: 0 24px 80px -28px rgba(11, 31, 58, 0.35);
    --auth-radius: 4px;
    --auth-font-display: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------
   Nav button — sits to the left of .lanwrap
   --------------------------------------------------------- */
.auth-nav-wrapper {
    position: relative;
    height: 72px;
    display: flex;
    align-items: center;
    margin-right: 18px;
    font-family: var(--auth-font-display);
}

.auth-nav-btn {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-ink);
    background: transparent;
    border: 1px solid var(--auth-ink);
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    position: relative;
}

.auth-nav-btn::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--auth-accent);
    margin-right: 10px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.auth-nav-btn:hover {
    background: var(--auth-ink);
    color: #fff;
}

.auth-nav-btn:hover::before {
    background: #fff;
    transform: rotate(225deg);
}

/* logged-in pill */
.auth-user-info {
    position: relative;
    height: 36px;
}

.auth-user-email {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px 0 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--auth-ink);
    border: 1px solid var(--auth-ink);
    cursor: pointer;
    user-select: none;
    transition: background 0.25s ease;
}

.auth-user-email::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #fff;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.auth-user-info.open .auth-user-email::after {
    transform: rotate(180deg);
}

.auth-user-email:hover {
    background: var(--auth-ink-soft);
}

.auth-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--auth-line);
    box-shadow: var(--auth-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.25s ease, visibility 0.2s;
    z-index: 1200;
}

.auth-user-info.open .auth-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.auth-user-menu::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 22px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid var(--auth-line);
    border-top: 1px solid var(--auth-line);
    transform: rotate(45deg);
}

.auth-user-menu a {
    display: block;
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--auth-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--auth-line);
    transition: background 0.2s ease, color 0.2s ease, padding 0.25s ease;
}

.auth-user-menu a:last-child {
    border-bottom: 0;
}

.auth-user-menu a:hover {
    background: var(--auth-bg);
    color: var(--auth-accent);
    padding-left: 24px;
}

/* ---------------------------------------------------------
   Modal — overlay + dialog
   --------------------------------------------------------- */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(11, 31, 58, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: var(--auth-font-display);
    animation: authFade 0.3s ease;
}

.auth-modal.is-open {
    display: flex;
}

@keyframes authFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-dialog {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    animation: authRise 0.45s cubic-bezier(.2,.8,.2,1);
}

.auth-dialog--wide {
    max-width: 560px;
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-dialog__head {
    position: relative;
    padding: 38px 44px 22px;
    background: var(--auth-ink);
    color: #fff;
    overflow: hidden;
}

.auth-dialog__head::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 140px;
    height: 140px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
}

.auth-dialog__head::before {
    content: "";
    position: absolute;
    right: 20px;
    top: 22px;
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
}

.auth-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.auth-eyebrow::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 1px;
    background: var(--auth-accent);
    vertical-align: middle;
    margin-right: 10px;
}

.auth-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.auth-subtitle {
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    position: relative;
    z-index: 1;
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.3s ease;
    z-index: 2;
}

.auth-close:hover {
    background: var(--auth-accent);
    transform: rotate(90deg);
}

.auth-dialog__body {
    padding: 30px 44px 36px;
    background: #fff;
}

/* View toggling */
.auth-view {
    display: none;
}
.auth-view.is-active {
    display: block;
}

/* Form */
.auth-form-row {
    margin-bottom: 18px;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--auth-mute);
    margin-bottom: 8px;
}

.auth-input,
.auth-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--auth-ink);
    background: #fff;
    border: 1px solid var(--auth-line-strong);
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-select {
    background-image: linear-gradient(45deg, transparent 50%, var(--auth-ink) 50%),
                      linear-gradient(135deg, var(--auth-ink) 50%, transparent 50%);
    background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.auth-input:focus,
.auth-select:focus {
    border-color: var(--auth-ink);
    box-shadow: 0 0 0 3px rgba(11, 31, 58, 0.08);
}

.auth-input[readonly] {
    background: var(--auth-bg);
    color: var(--auth-mute);
    cursor: not-allowed;
}

/* Radio group for gender */
.auth-radio-group {
    display: flex;
    gap: 10px;
}

.auth-radio {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.auth-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-radio span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-ink-soft);
    background: #fff;
    border: 1px solid var(--auth-line-strong);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.auth-radio input:checked + span {
    color: #fff;
    background: var(--auth-ink);
    border-color: var(--auth-ink);
}

.auth-radio:hover span {
    border-color: var(--auth-ink-soft);
}

/* Submit button */
.auth-submit {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff;
    background: var(--auth-ink);
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease, transform 0.2s ease;
}

.auth-submit::after {
    content: "→";
    margin-left: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.auth-submit:hover {
    background: var(--auth-accent);
}

.auth-submit:hover::after {
    transform: translateX(6px);
}

.auth-submit:active {
    transform: translateY(1px);
}

/* Switch link */
.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: var(--auth-mute);
}

.auth-switch a {
    color: var(--auth-ink);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid var(--auth-accent);
    padding-bottom: 1px;
    margin-left: 6px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: var(--auth-accent);
}

/* Inline message / error */
.auth-message {
    display: none;
    margin: 0 0 18px;
    padding: 12px 14px;
    font-size: 13px;
    border-left: 3px solid var(--auth-accent);
    background: #fdf3f5;
    color: #8a1d2a;
}

.auth-message.is-success {
    border-left-color: #2f8f5f;
    background: #effaf3;
    color: #1e5a3c;
}

.auth-message.is-visible {
    display: block;
    animation: authFade 0.3s ease;
}

/* Decorative meta row */
.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 26px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--auth-line);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--auth-mute);
}

.auth-meta span:last-child {
    color: var(--auth-ink);
    font-weight: 700;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 991px) {
    .auth-nav-wrapper {
        height: auto;
        margin: 10px 0 10px;
    }
    .auth-nav-btn,
    .auth-user-email {
        height: 40px;
    }
    .auth-user-menu {
        right: auto;
        left: 0;
    }
    .auth-user-menu::before {
        right: auto;
        left: 22px;
    }
}

@media (max-width: 575px) {
    .auth-modal {
        padding: 12px;
    }
    .auth-dialog__head {
        padding: 30px 24px 20px;
    }
    .auth-dialog__body {
        padding: 24px 24px 28px;
    }
    .auth-title {
        font-size: 22px;
    }
    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .auth-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Top bar for detail pages without full navigation */
.auth-topbar {
  background: #0b1f3a;
  padding: 10px 0;
  position: relative;
  z-index: 100;
}
.auth-topbar .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.auth-topbar-right {
  display: flex;
  align-items: center;
}
.auth-topbar .auth-nav-btn {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
.auth-topbar .auth-nav-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}
.auth-topbar .auth-user-email {
  color: #fff;
}
.auth-topbar .auth-user-menu {
  top: 100%;
  right: 0;
}
