/* ============================================
   LANTIA — Premium Login
   "Where knowledge comes to life"
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Variables ---------- */
:root {
    --bg-deep: #0f172a;
    --bg-mid: #1e293b;
    --bg-light: #334155;
    --accent: #2563eb;
    --accent-hover: #3b82f6;
    --accent-glow: rgba(37, 99, 235, .35);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --glass-bg: rgba(30, 41, 59, .55);
    --glass-border: rgba(148, 163, 184, .12);
    --error-bg: rgba(239, 68, 68, .08);
    --error-border: rgba(239, 68, 68, .25);
    --error-text: #fca5a5;
    --success-bg: rgba(34, 197, 94, .08);
    --success-border: rgba(34, 197, 94, .25);
    --success-text: #86efac;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Full-screen wrapper ---------- */
.ln-login-page {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-deep);
    position: relative;
    overflow: hidden;
}

/* ---------- Animated Canvas Background ---------- */
#ln-canvas-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ---------- LEFT COLUMN — Brand ---------- */
.ln-brand-col {
    flex: 1 1 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5vw 4vw 5vw 6vw;
    position: relative;
    z-index: 1;
}

.ln-brand-col__inner {
    max-width: 600px;
}

.ln-brand-logo {
    width: 220px;
    margin-bottom: 48px;
    opacity: .9;
}

.ln-publisher-logo-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 18px 28px;
    margin-bottom: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
}

.ln-publisher-logo {
    max-width: 200px;
    max-height: 80px;
    width: auto;
    height: auto;
    display: block;
}

.ln-brand-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 3.4vw, 3.4rem);
    line-height: 1.18;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -.02em;
}

.ln-brand-heading em {
    font-style: italic;
    color: var(--accent);
}

.ln-brand-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 520px;
}

/* Feature bullets */
.ln-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ln-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: .95rem;
    font-weight: 400;
}

.ln-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, .10);
    flex-shrink: 0;
}

.ln-feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- RIGHT COLUMN — Card ---------- */
.ln-form-col {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 2;
}

.ln-card {
    width: 100%;
    max-width: 430px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 44px 38px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25), 0 0 0 1px rgba(255, 255, 255, .04) inset;
    animation: ln-cardIn .7s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes ln-cardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ln-card__title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ln-card__subtitle {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ---------- Google Button ---------- */
.ln-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
    color: var(--text-primary);
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.ln-btn-google:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(148, 163, 184, .25);
    transform: translateY(-1px);
}

.ln-btn-google:active {
    transform: translateY(0);
}

.ln-btn-google img {
    width: 20px;
    height: 20px;
}

/* ---------- Separator ---------- */
.ln-separator {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
}

.ln-separator::before,
.ln-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.ln-separator span {
    font-size: .78rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: lowercase;
    letter-spacing: .02em;
}

/* ---------- Inputs ---------- */
.ln-field {
    position: relative;
    margin-bottom: 16px;
}

.ln-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

.ln-field input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, .5);
    color: var(--text-primary);
    font-size: .92rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.ln-field input::placeholder {
    color: var(--text-muted);
}

.ln-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.ln-field input:focus~.ln-field__icon {
    color: var(--accent);
}

/* Password toggle */
.ln-field__toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.ln-field__toggle:hover {
    color: var(--text-secondary);
}

/* Error state on field */
.ln-field--error input {
    border-color: var(--error-border) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}

/* ---------- Submit Button ---------- */
.ln-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    margin-top: 6px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.ln-btn-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 24px var(--accent-glow);
    transform: translateY(-1px);
}

.ln-btn-submit:active {
    transform: translateY(0);
}

.ln-btn-submit .ln-spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ln-spin .6s linear infinite;
}

.ln-btn-submit.is-loading .ln-spinner {
    display: block;
}

.ln-btn-submit.is-loading .ln-btn-label {
    opacity: 0;
}

@keyframes ln-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Inline field error message */
.ln-field-error-msg {
    display: none;
    font-size: .78rem;
    line-height: 1.3;
    color: #f87171;
    margin: 6px 0 2px 0;
    padding-left: 14px;
    letter-spacing: .01em;
}

.ln-field--error+.ln-field-error-msg {
    display: block;
}

/* ---------- Forgot link ---------- */
.ln-forgot {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: .84rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    font-family: inherit;
}

.ln-forgot:hover {
    color: var(--accent);
}

/* ---------- Error Alert ---------- */
.ln-alert {
    display: none;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    animation: ln-alertIn .35s ease both;
}

.ln-alert.is-visible {
    display: flex;
}

@keyframes ln-alertIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ln-alert--error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
}

.ln-alert--success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.ln-alert__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.ln-alert--error .ln-alert__icon {
    color: #f87171;
}

.ln-alert--success .ln-alert__icon {
    color: #4ade80;
}

.ln-alert__body {
    flex: 1;
}

.ln-alert__title {
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.ln-alert--error .ln-alert__title {
    color: #fca5a5;
}

.ln-alert--success .ln-alert__title {
    color: #86efac;
}

.ln-alert__text {
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ---------- Forgot Password Panel ---------- */
.ln-forgot-panel {
    display: none;
}

.ln-forgot-panel.is-active {
    display: block;
    animation: ln-cardIn .45s cubic-bezier(.16, 1, .3, 1) both;
}

.ln-login-panel.is-hidden {
    display: none;
}

.ln-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .84rem;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 20px;
    transition: color var(--transition);
    padding: 0;
}

.ln-back-btn:hover {
    color: var(--accent);
}

/* ---------- Language Selector ---------- */
.ln-lang-selector {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
}

.ln-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(30, 41, 59, .6);
    color: var(--text-secondary);
    font-size: .82rem;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    backdrop-filter: blur(8px);
}

.ln-lang-btn:hover {
    background: rgba(30, 41, 59, .85);
    border-color: rgba(148, 163, 184, .25);
}

.ln-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    background: var(--bg-mid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    overflow: hidden;
    animation: ln-dropIn .2s ease both;
}

.ln-lang-dropdown.is-open {
    display: block;
}

@keyframes ln-dropIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ln-lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: .84rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.ln-lang-option:hover {
    background: rgba(37, 99, 235, .1);
    color: var(--text-primary);
}

.ln-lang-option.is-active {
    color: var(--accent);
}

/* ---------- Footer ---------- */
.ln-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: .76rem;
    color: var(--text-muted);
    z-index: 1;
    letter-spacing: .01em;
}

/* ---------- Maintenance ---------- */
.ln-maintenance {
    text-align: center;
    padding: 20px 0;
}

.ln-maintenance__icon {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 16px;
}

.ln-maintenance__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ln-maintenance__text {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===============================
   RESPONSIVE
   =============================== */

/* Tablet */
@media (max-width: 1024px) {
    .ln-brand-col {
        flex: 1 1 50%;
        padding: 4vw 3vw 4vw 4vw;
    }

    .ln-form-col {
        flex: 1 1 50%;
        padding: 30px;
    }

    .ln-brand-heading {
        font-size: clamp(1.8rem, 2.8vw, 2.6rem);
    }

    .ln-brand-subtitle {
        font-size: .95rem;
    }
}

/* Tablet portrait & small screens */
@media (max-width: 860px) {
    .ln-login-page {
        flex-direction: column;
        overflow-y: auto;
    }

    .ln-brand-col {
        flex: none;
        padding: 48px 28px 28px;
        text-align: center;
        align-items: center;
    }

    .ln-brand-col__inner {
        max-width: 480px;
        margin: 0 auto;
    }

    .ln-brand-heading {
        font-size: 1.7rem;
    }

    .ln-brand-subtitle {
        font-size: .9rem;
        margin-bottom: 28px;
        max-width: 100%;
    }

    .ln-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .ln-features li {
        font-size: .82rem;
        gap: 8px;
    }

    .ln-feature-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .ln-feature-icon svg {
        width: 16px;
        height: 16px;
    }

    .ln-form-col {
        flex: none;
        padding: 20px 24px 60px;
    }

    .ln-card {
        max-width: 440px;
        padding: 32px 28px 28px;
    }

    .ln-footer {
        position: relative;
        bottom: auto;
        padding: 20px 0;
    }
}

/* Phone */
@media (max-width: 540px) {
    .ln-brand-col {
        padding: 36px 20px 20px;
    }

    .ln-brand-logo {
        width: 160px;
        margin-bottom: 28px;
    }

    .ln-brand-heading {
        font-size: 1.45rem;
    }

    .ln-brand-subtitle {
        font-size: .85rem;
        margin-bottom: 20px;
    }

    .ln-features {
        gap: 8px;
    }

    .ln-feature-icon {
        display: none;
    }

    .ln-form-col {
        padding: 12px 16px 48px;
    }

    .ln-card {
        padding: 28px 22px 24px;
        border-radius: 14px;
    }

    .ln-card__title {
        font-size: 1.3rem;
    }

    .ln-lang-selector {
        top: 14px;
        right: 14px;
    }
}