/**
 * Happy People custom login (hp-login.php).
 */

body.hp-login-page {
    margin: 0;
    background: #06101c;
    color: var(--hp-ink, #1a1a1a);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.hp-login-page #page.hp-login-site {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
}

.hp-login-page h1,
.hp-login-page h2,
.hp-login-page h3 {
    font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
}

.hp-login-shell {
    --login-navy: #06101c;
    --login-navy-mid: #0c1f38;
    --login-navy-deep: #002d62;
    --login-gold: #c9a06a;
    --login-accent: #1a4480;
    --login-accent-deep: #002d62;
    --login-accent-shadow: #001a3d;
    --login-accent-rgb: 0, 45, 98;
    --login-mesh-highlight: rgba(26, 68, 128, 0.42);
    --login-mesh-gold: rgba(201, 160, 106, 0.14);
    --login-mesh-depth: rgba(0, 26, 61, 0.78);
    --login-mesh-base: linear-gradient(165deg, #06101c 0%, #0c1f38 48%, #07182c 100%);
    --login-orb-1: #1a4480;
    --login-orb-2: #2a5f9e;
    --login-orb-3: #0d2847;
    --login-card-border: linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(26, 68, 128, 0.28) 50%, rgba(255, 255, 255, 0.16) 100%);
    --login-ring: conic-gradient(from 210deg, #1a4480, var(--login-gold), #fff 25%, #002d62 70%, #2a5f9e);
    --login-glass: rgba(255, 255, 255, 0.72);
    --login-glass-border: rgba(255, 255, 255, 0.55);
    --login-glass-shadow: 0 24px 80px rgba(4, 12, 24, 0.48);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    position: relative;
    min-height: 100dvh;
    background: var(--login-navy);
    overflow-x: hidden;
}

.hp-login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hp-login-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 15% 0%, var(--login-mesh-highlight) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 95% 15%, var(--login-mesh-gold) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 50% 100%, var(--login-mesh-depth) 0%, transparent 60%),
        var(--login-mesh-base);
}

.hp-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
}

.hp-login-orb--1 {
    width: 180px;
    height: 180px;
    top: -40px;
    left: -30px;
    background: var(--login-orb-1);
}

.hp-login-orb--2 {
    width: 140px;
    height: 140px;
    top: 18%;
    right: -20px;
    background: var(--login-orb-2);
    opacity: 0.35;
}

.hp-login-orb--3 {
    width: 220px;
    height: 220px;
    bottom: -60px;
    left: 20%;
    background: var(--login-orb-3);
    opacity: 0.4;
}

@media (prefers-reduced-motion: no-preference) {
    .hp-login-orb--1 {
        animation: hp-login-orb-drift 14s ease-in-out infinite alternate;
    }

    .hp-login-orb--2 {
        animation: hp-login-orb-drift 18s ease-in-out infinite alternate-reverse;
    }

    .hp-login-orb--3 {
        animation: hp-login-orb-drift 20s ease-in-out infinite alternate;
    }

    @keyframes hp-login-orb-drift {
        from {
            transform: translate(0, 0) scale(1);
        }

        to {
            transform: translate(12px, 18px) scale(1.08);
        }
    }
}

.hp-login-scene {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    gap: 24px;
    padding:
        calc(28px + env(safe-area-inset-top, 0px))
        20px
        calc(24px + var(--safe-bottom));
}

.hp-login-hero {
    text-align: center;
    width: 100%;
    max-width: 360px;
    flex-shrink: 0;
}

.hp-login-brand-mark {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
}

.hp-login-brand-ring {
    position: absolute;
    inset: -6px;
    border-radius: 28px;
    background: var(--login-ring);
    opacity: 0.85;
    filter: blur(0.5px);
}

.hp-login-brand-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.hp-login-brand-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hp-login-tagline {
    margin: 0 auto;
    max-width: 300px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

.hp-login-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.hp-login-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: var(--hp-radius-pill, 999px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.hp-login-chip i {
    font-size: 10px;
    color: var(--login-gold);
}

.hp-login-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0;
    padding: 2px;
    border-radius: 22px;
    background: var(--login-card-border);
    box-shadow: var(--login-glass-shadow);
}

.hp-login-card-inner {
    background: var(--login-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-radius: 20px;
    padding: 24px 20px 20px;
    border: 1px solid var(--login-glass-border);
}

.hp-login-card-heading {
    margin-bottom: 20px;
}

.hp-login-card-heading h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--hp-brand, #002d62);
    letter-spacing: -0.02em;
}

.hp-login-card-heading p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--hp-text-muted, #6b7280);
}

.hp-login-error {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--hp-radius-control, 12px);
    background: rgba(254, 242, 242, 0.95);
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.4;
}

.hp-login-error.is-visible {
    display: flex;
}

.hp-login-error i {
    margin-top: 2px;
    flex-shrink: 0;
}

.hp-login-field {
    margin-bottom: 14px;
}

.hp-login-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--hp-brand, #002d62);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hp-login-field-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 50px;
    border-radius: var(--hp-radius-control, 12px);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 45, 98, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hp-login-field-shell:focus-within {
    border-color: rgba(var(--login-accent-rgb), 0.55);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--login-accent-rgb), 0.12);
}

.hp-login-field-shell i.hp-login-field-icon {
    color: var(--hp-text-muted, #6b7280);
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.hp-login-field-shell:focus-within i.hp-login-field-icon {
    color: var(--login-accent-deep);
}

.hp-login-field-shell input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: var(--hp-ink, #1a1a1a);
    min-width: 0;
}

.hp-login-field-shell input::placeholder {
    color: #9ca3af;
}

.hp-login-password-toggle {
    border: none;
    background: none;
    color: var(--hp-text-muted, #6b7280);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1;
}

.hp-login-password-toggle:hover {
    color: var(--login-accent-deep);
    background: rgba(var(--login-accent-rgb), 0.12);
}

.hp-login-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 18px;
}

.hp-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--hp-ink, #1a1a1a);
}

.hp-login-remember input {
    display: none;
}

.hp-login-remember-track {
    width: 40px;
    height: 24px;
    border-radius: var(--hp-radius-pill, 999px);
    background: #d1d5db;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hp-login-remember-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.hp-login-remember input:checked + .hp-login-remember-track {
    background: linear-gradient(135deg, var(--login-accent) 0%, var(--login-accent-deep) 100%);
}

.hp-login-remember input:checked + .hp-login-remember-track::after {
    transform: translateX(16px);
}

.hp-login-button {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: var(--hp-radius-pill, 999px);
    font-family: Manrope, sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--login-accent) 0%, var(--login-accent-deep) 55%, var(--login-accent-shadow) 100%);
    box-shadow:
        0 4px 20px rgba(var(--login-accent-rgb), 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    position: relative;
    overflow: hidden;
}

.hp-login-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
}

.hp-login-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(var(--login-accent-rgb), 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hp-login-button:hover:not(:disabled)::after {
    transform: translateX(120%);
}

.hp-login-button:active:not(:disabled) {
    transform: translateY(0);
}

.hp-login-button:disabled {
    filter: grayscale(0.35);
    opacity: 0.75;
    cursor: not-allowed;
    box-shadow: none;
}

.hp-login-footer {
    width: 100%;
    max-width: 360px;
    flex-shrink: 0;
    text-align: center;
}

.hp-login-forgot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--hp-radius-pill, 999px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s;
}

.hp-login-forgot:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.hp-login-legal {
    margin: 14px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.hp-login-legal a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-weight: 600;
}

.hp-login-legal a:hover {
    color: #fff;
    text-decoration: underline;
}

.hp-login-hp {
    position: absolute;
    left: -6000px;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}
