/**
 * Liquid-glass styling shared by the standalone auth screens
 * (login, register, reset-password). Built on top of the brand
 * tokens already defined in custom.css - no external images or
 * frameworks, pure CSS gradients/backdrop-filter.
 */

/* ---------- Background ---------- */

body.auth-glass-bg {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
    overflow-x: hidden;
    background:
        radial-gradient(at 12% 18%, rgba(236, 131, 56, 0.35) 0, transparent 42%),
        radial-gradient(at 88% 12%, rgba(200, 144, 110, 0.30) 0, transparent 48%),
        radial-gradient(at 82% 88%, rgba(245, 160, 92, 0.22) 0, transparent 50%),
        radial-gradient(at 15% 85%, rgba(89, 89, 166, 0.35) 0, transparent 50%),
        linear-gradient(135deg, #1c1c46 0%, #2a2a5e 35%, #37377d 65%, #4a4a96 100%);
    background-attachment: fixed;
}

body.auth-glass-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Floating glass orbs (decorative) ---------- */

.glass-orb {
    position: fixed;
    z-index: 1;
    border-radius: 50%;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: glass-orb-float 8s ease-in-out infinite;
}

.glass-orb--1 {
    top: 12%;
    left: 10%;
    width: 180px;
    height: 180px;
    background: rgba(236, 131, 56, 0.25);
    animation-delay: 0s;
}

.glass-orb--2 {
    bottom: 15%;
    right: 12%;
    width: 140px;
    height: 140px;
    background: rgba(89, 89, 166, 0.28);
    animation-delay: 1.5s;
}

.glass-orb--3 {
    top: 55%;
    right: 22%;
    width: 90px;
    height: 90px;
    background: rgba(200, 144, 110, 0.3);
    animation-delay: 0.8s;
}

@keyframes glass-orb-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: .55; }
    50% { transform: translateY(-18px) scale(1.05); opacity: .8; }
}

@media (prefers-reduced-motion: reduce) {
    .glass-orb { animation: none; }
}

@media (max-width: 576px) {
    /* On narrow viewports the card spans nearly the full width, so orbs
       are pushed into the corners (mostly clipped off-screen) instead of
       sitting behind the card - centered orbs there would wash out the
       glass card's contrast under its backdrop-filter blur. */
    .glass-orb--3 { display: none; }
    .glass-orb--1 {
        top: -50px;
        left: -50px;
        width: 140px;
        height: 140px;
    }
    .glass-orb--2 {
        top: auto;
        bottom: -40px;
        right: -40px;
        width: 110px;
        height: 110px;
    }
}

/* ---------- Glass card ---------- */

.glass-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 450px;
    margin: 20px auto;
    padding: 40px 35px;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 25px 70px rgba(15, 15, 45, 0.35),
        0 8px 24px rgba(15, 15, 45, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: glass-card-in 0.5s ease-in-out;
    transition: box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow:
        0 30px 80px rgba(15, 15, 45, 0.4),
        0 10px 28px rgba(15, 15, 45, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.glass-card--wide {
    max-width: 700px;
}

@keyframes glass-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@supports not (backdrop-filter: blur(1px)) {
    .glass-card { background: rgba(255, 255, 255, 0.92); }
}

@media (max-width: 576px) {
    .glass-card { margin: 15px; padding: 26px 22px; }
}

/* ---------- Card header ---------- */

.glass-card__header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(55, 55, 125, 0.15);
}

.glass-card__header img {
    max-width: 110px;
    height: auto;
    margin: 0 auto 10px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(15, 15, 45, 0.25));
    transition: transform 0.3s ease;
}

.glass-card__header img:hover {
    transform: scale(1.05);
}

.glass-card__title {
    color: var(--primary-color, #37377d);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 4px 0 2px;
}

.glass-card__subtitle {
    font-size: 1rem;
    color: rgba(42, 42, 94, 0.65);
    font-weight: 500;
    letter-spacing: 0.4px;
}

/* ---------- Form controls ---------- */

.auth-glass-bg .form-control,
.auth-glass-bg .form-select {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(55, 55, 125, 0.25);
    color: #2a2a5e;
    border-radius: 0.6rem;
    padding: 0.65rem 0.9rem;
    transition: all 0.2s ease;
}

.auth-glass-bg .form-control::placeholder {
    color: rgba(42, 42, 94, 0.45);
}

.auth-glass-bg .form-control:focus,
.auth-glass-bg .form-select:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color, #37377d);
    box-shadow: 0 0 0 0.2rem rgba(55, 55, 125, 0.2);
}

.auth-glass-bg .form-control.is-invalid,
.auth-glass-bg .form-select.is-invalid {
    border-color: #e05252;
}

.auth-glass-bg .form-label {
    color: #2a2a5e;
    font-weight: 500;
}

.auth-glass-bg .form-check-label {
    color: rgba(42, 42, 94, 0.85);
}

.auth-glass-bg .form-text,
.auth-glass-bg small.text-muted {
    color: rgba(42, 42, 94, 0.6) !important;
}

.auth-glass-bg .progress {
    background: rgba(55, 55, 125, 0.12);
}

/* ---------- Password visibility toggle ---------- */

.auth-glass-bg .password-container {
    position: relative;
}

.auth-glass-bg .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(42, 42, 94, 0.55);
    transition: color 0.2s ease;
}

.auth-glass-bg .password-toggle:hover {
    color: var(--primary-color, #37377d);
}

/* ---------- Buttons ---------- */

.auth-glass-bg .btn-primary {
    background: var(--primary-color, #37377d);
    border-color: var(--primary-color, #37377d);
    font-weight: 600;
    border-radius: 0.6rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.auth-glass-bg .btn-primary:hover {
    background: var(--primary-dark, #2a2a5e);
    border-color: var(--primary-dark, #2a2a5e);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(42, 42, 94, 0.35);
}

.auth-glass-bg .btn-primary::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.auth-glass-bg .btn-primary:active::before {
    width: 260px;
    height: 260px;
}

.auth-glass-bg .btn-outline-secondary,
.auth-glass-bg .btn-secondary {
    border-radius: 0.6rem;
}

/* ---------- Links ---------- */

.auth-glass-bg .glass-card a:not(.btn) {
    color: var(--primary-color, #37377d);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-glass-bg .glass-card a:not(.btn):hover {
    color: var(--secondary-color, #ec8338);
}

.auth-glass-bg .form-toggle {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(55, 55, 125, 0.15);
}

/* ---------- Alerts ---------- */

.auth-glass-bg .alert {
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid transparent;
}

.auth-glass-bg .alert-warning {
    background: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.4);
    color: #8a6100;
}

.auth-glass-bg .alert-info {
    background: rgba(13, 202, 240, 0.18);
    border-color: rgba(13, 202, 240, 0.4);
    color: #055160;
}

.auth-glass-bg .alert-danger {
    background: rgba(220, 53, 69, 0.16);
    border-color: rgba(220, 53, 69, 0.4);
    color: #7a1a26;
}

.auth-glass-bg .alert-success {
    background: rgba(25, 135, 84, 0.16);
    border-color: rgba(25, 135, 84, 0.4);
    color: #0f5132;
}
