/* ============================================
   PerúClown — Login (split panel, sharp edges)
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body.login-page {
    font-family: var(--font-sans);
    font-feature-settings: var(--font-features);
    color: #f4f4f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    background: #0e0e0e;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    position: relative;
    z-index: 1;
}

.login-panel {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #0e0e0e;
    border: none;
    box-shadow: none;
    overflow: hidden;
    border-radius: 0;
}

/* ---- Form side ---- */
.login-form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px 40px;
    background: #0e0e0e;
    position: relative;
}

.login-title {
    font-family: var(--font-sans);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 10px;
}

.login-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: #a1a1aa;
    margin-bottom: 28px;
    max-width: 32ch;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    margin-bottom: 18px;
    border-radius: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #e4e4e7;
    margin-bottom: 8px;
}

.field-input-wrap {
    position: relative;
}

.field input {
    width: 100%;
    height: 48px;
    background: #141414;
    border: 1px solid #3f3f46;
    color: #fafafa;
    padding: 0 14px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    border-radius: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
    color: #71717a;
    font-weight: 400;
}

.field input:focus {
    border-color: #a1a1aa;
    background: #181818;
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fafafa;
    -webkit-box-shadow: 0 0 0 1000px #141414 inset;
    box-shadow: 0 0 0 1000px #141414 inset;
    transition: background-color 9999s ease-in-out 0s;
}

.password-mask {
    -webkit-text-security: disc;
    text-security: disc;
    padding-right: 44px;
}

@supports not (-webkit-text-security: disc) {
    .password-mask {
        color: transparent;
        text-shadow: 0 0 0 #fafafa;
        letter-spacing: 0.08em;
    }
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
}

.password-toggle:hover {
    color: #f4f4f5;
}

.field .error {
    color: #f87171;
    font-size: 11px;
    margin-top: 6px;
    font-family: var(--font-mono);
    display: block;
}

.login-btn {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    background: #ffffff;
    color: #0e0e0e;
    border: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.login-btn:hover:not(:disabled) {
    background: #f4f4f5;
}

.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 16px;
    color: #71717a;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #3f3f46;
}

.passkey-btn {
    width: 100%;
    height: 48px;
    background: #141414;
    color: #f4f4f5;
    border: 1px solid #3f3f46;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.passkey-btn:hover:not(:disabled) {
    background: #1c1c1c;
    border-color: #52525b;
}

.passkey-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.login-footer {
    margin-top: 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #a1a1aa;
    text-align: center;
}

.login-footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-brand-mark {
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    align-items: center;
}

.login-brand-mark img {
    height: 48px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* ---- Visual side ---- */
.login-visual-side {
    position: relative;
    min-height: 320px;
    background: #111;
    overflow: hidden;
    border-radius: 0;
}

.login-visual-side img,
.login-visual-side .login-visual-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.login-visual-side .login-visual-video {
    border: none;
    pointer-events: none;
}

.login-visual-side::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.2) 42%,
        rgba(0, 0, 0, 0.05) 100%
    );
    pointer-events: none;
}

.login-quotes {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.login-quote {
    background: rgba(18, 18, 18, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 0;
    min-width: 0;
}

.login-quote-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.login-quote-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: #e8d4c4;
    border-radius: 0;
}

.login-quote-name {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-quote-handle {
    font-family: var(--font-mono);
    font-size: 9px;
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-quote p {
    font-family: var(--font-sans);
    font-size: 11px;
    line-height: 1.4;
    color: #e4e4e7;
}

.version-badge {
    position: fixed;
    bottom: 14px;
    right: 16px;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    z-index: 10;
}

@media (max-width: 900px) {
    .login-panel {
        grid-template-columns: 1fr;
        max-width: none;
        min-height: 100vh;
    }

    .login-visual-side {
        display: none;
    }

    .login-form-side {
        padding: 28px 24px;
        min-height: 100vh;
        justify-content: center;
    }

    .login-brand-mark {
        margin-bottom: 16px;
    }

    .login-brand-mark img {
        height: 44px;
    }
}

@media (max-width: 480px) {
    .login-shell {
        padding: 0;
    }

    .login-title {
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-btn,
    .passkey-btn,
    .field input {
        transition: none;
    }
}
