/* Bwiser Control — Login & Auth pages
 * Branded styling voor login, wachtwoord-vergeten, email-link login & 2FA.
 * Zelfde bewezen structuur als RelayPro, maar volledig in de Bwiser Control
 * huisstijl: dark void mission-control brand-panel + warm cream editorial form,
 * ember-accenten, Fraunces/Geist/JetBrains Mono (matcht de console-SPA tokens).
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* --- Variables (Bwiser Control ember/cream palette, form-zijde) --- */
:root {
    --rp-login-primary: #c95e1c;           /* ember-deep — leesbaar op cream */
    --rp-login-primary-hover: #a84d14;
    --rp-login-primary-light: rgba(255, 140, 66, 0.10);
    --rp-login-primary-glow: rgba(255, 140, 66, 0.20);
    --rp-login-accent: #ff8c42;            /* ember — accenten op dark bg */
    --rp-login-text: #1a1612;              /* drukinkt-deep */
    --rp-login-text-muted: #5f5644;        /* secondary */
    --rp-login-text-light: #8a8170;        /* muted */
    --rp-login-border: #cabfa6;            /* warm border */
    --rp-login-bg: #f5f1e8;                /* cream paper */
    --rp-login-card: #fffaf2;              /* elevated cream */
    --rp-login-input-bg: #f5f1e8;
    --rp-login-input-border: #cabfa6;
    --rp-login-input-focus: #c95e1c;
    --rp-login-danger: #bc4749;            /* rust */
    --rp-login-success: #7fb069;           /* kelp */
    --rp-login-radius: 16px;
    --rp-login-radius-sm: 9px;
    --rp-font-display: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --rp-font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --rp-font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* --- Base --- */
body.rp-login-page {
    font-family: var(--rp-font-body);
    background: var(--rp-login-bg);
    color: var(--rp-login-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.rp-login-page .web-footer,
body.rp-login-page .navbar,
body.rp-login-page .page-header {
    display: none !important;
}

/* --- Split Layout --- */
.rp-login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Left branded panel — pitch-black mission-control */
.rp-login-brand {
    flex: 0 0 44%;
    background: #0a0908;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

/* Grid lines — subtiel ember-getint */
.rp-login-brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 140, 66, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 140, 66, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 30% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 50%, black, transparent);
    pointer-events: none;
    z-index: 0;
}

/* Ember glow orb, top-right */
.rp-login-brand::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    top: -150px;
    right: -150px;
    background: radial-gradient(circle, rgba(255, 140, 66, 0.16) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: rp-glow-pulse 6s ease-in-out infinite;
}

/* Second glow, bottom-left */
.rp-login-brand::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    bottom: -100px;
    left: -80px;
    background: radial-gradient(circle, rgba(201, 94, 28, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: rp-glow-pulse 8s ease-in-out 3s infinite;
}

.rp-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
}

.rp-brand-logo {
    margin-bottom: 28px;
}

.rp-brand-logo svg {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 4px 16px rgba(255, 140, 66, 0.25));
}

.rp-brand-name {
    font-family: var(--rp-font-display);
    font-variation-settings: 'opsz' 40, 'SOFT' 50;
    font-size: 46px;
    font-weight: 600;
    color: #f4ede4;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    line-height: 1.05;
}

.rp-brand-name .rp-brand-accent {
    color: #ff8c42;
}

.rp-brand-tagline {
    font-family: var(--rp-font-body);
    font-size: 15.5px;
    font-weight: 300;
    color: rgba(244, 237, 228, 0.62);
    line-height: 1.6;
    margin-bottom: 44px;
}

.rp-brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.rp-brand-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(244, 237, 228, 0.85);
    font-size: 14px;
    font-weight: 400;
}

.rp-brand-feature-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 140, 66, 0.10);
    border: 1px solid rgba(255, 140, 66, 0.18);
    color: #ff8c42;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Right form panel — warm cream */
.rp-login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 40px 0;
    background: linear-gradient(180deg, #fffaf2 0%, #f5f1e8 100%);
    position: relative;
    min-height: 0;
}

.rp-login-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(201, 94, 28, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
}

.rp-login-form-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: rp-fadeIn 0.4s ease;
}

/* --- Form Card --- */
.rp-login-card {
    background: var(--rp-login-card);
    border: 1px solid var(--rp-login-border);
    border-radius: var(--rp-login-radius);
    padding: 32px;
    box-shadow:
        0 1px 3px rgba(26, 22, 18, 0.05),
        0 8px 30px rgba(26, 22, 18, 0.05);
}

/* --- Section Headers --- */
.rp-login-header {
    margin-bottom: 30px;
}

.rp-login-header h2 {
    font-family: var(--rp-font-display);
    font-variation-settings: 'opsz' 32, 'SOFT' 60;
    font-size: 34px;
    font-weight: 600;
    color: var(--rp-login-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.01em;
}

.rp-login-header p {
    font-size: 15px;
    color: var(--rp-login-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* --- Form Inputs --- */
.rp-form-group {
    margin-bottom: 20px;
}

.rp-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rp-login-text);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.rp-input-wrapper {
    position: relative;
}

.rp-input-wrapper .rp-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rp-login-text-light);
    pointer-events: none;
    transition: color 0.2s;
}

.rp-input-wrapper input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1.5px solid var(--rp-login-input-border);
    border-radius: var(--rp-login-radius-sm);
    font-family: var(--rp-font-body);
    font-size: 15px;
    color: var(--rp-login-text);
    background: var(--rp-login-input-bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-sizing: border-box;
}

.rp-input-wrapper input::placeholder {
    color: var(--rp-login-text-light);
}

.rp-input-wrapper input:focus {
    border-color: var(--rp-login-input-focus);
    box-shadow: 0 0 0 3px var(--rp-login-primary-glow);
    background: #fffdf9;
}

.rp-input-wrapper input:focus ~ .rp-input-icon {
    color: var(--rp-login-primary);
}

.rp-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--rp-login-text-muted);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    z-index: 2;
    background: none;
    border: none;
    padding: 2px 4px;
}

.rp-toggle-password:hover {
    color: var(--rp-login-primary);
}

/* --- Buttons --- */
.rp-btn-login {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--rp-login-radius-sm);
    font-family: var(--rp-font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rp-btn-primary {
    background: var(--rp-login-primary);
    color: #fffaf2;
    box-shadow: 0 1px 3px rgba(201, 94, 28, 0.3);
}

.rp-btn-primary:hover {
    background: var(--rp-login-primary-hover);
    box-shadow: 0 4px 14px rgba(201, 94, 28, 0.32);
    transform: translateY(-1px);
}

.rp-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(201, 94, 28, 0.3);
}

.rp-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rp-btn-secondary {
    background: var(--rp-login-card);
    color: var(--rp-login-text);
    border: 1.5px solid var(--rp-login-border);
}

.rp-btn-secondary:hover {
    background: var(--rp-login-primary-light);
    border-color: var(--rp-login-primary);
    color: var(--rp-login-primary);
}

/* --- Links --- */
.rp-forgot-link {
    display: block;
    text-align: right;
    margin-top: -12px;
    margin-bottom: 20px;
}

.rp-forgot-link a {
    font-size: 13px;
    font-weight: 500;
    color: var(--rp-login-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.rp-forgot-link a:hover {
    color: var(--rp-login-primary-hover);
    text-decoration: underline;
}

.rp-signup-link {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--rp-login-text-muted);
}

.rp-signup-link a {
    color: var(--rp-login-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.rp-signup-link a:hover {
    color: var(--rp-login-primary-hover);
    text-decoration: underline;
}

.rp-back-link {
    text-align: center;
    margin-top: 16px;
}

.rp-back-link a {
    font-size: 13px;
    font-weight: 500;
    color: var(--rp-login-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.rp-back-link a:hover {
    color: var(--rp-login-primary);
}

/* --- Divider --- */
.rp-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 16px;
}

.rp-divider::before,
.rp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rp-login-border);
}

.rp-divider span {
    font-size: 12px;
    font-weight: 500;
    color: var(--rp-login-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Social / email-link buttons --- */
.rp-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rp-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--rp-login-border);
    border-radius: var(--rp-login-radius-sm);
    background: var(--rp-login-card);
    font-family: var(--rp-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--rp-login-text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.rp-social-btn:hover {
    background: var(--rp-login-primary-light);
    border-color: var(--rp-login-primary);
    color: var(--rp-login-primary);
}

.rp-social-btn img {
    width: 18px;
    height: 18px;
}

/* --- Error / Invalid State --- */
.rp-login-form-container.invalid-login,
.login-content.page-card.invalid-login {
    animation: rp-shake 0.4s ease;
}

.rp-form-group.invalid input,
.page-card-body.invalid input {
    border-color: var(--rp-login-danger);
    box-shadow: 0 0 0 3px rgba(188, 71, 73, 0.12);
}

/* --- Floating Nodes (fleet) --- */
.rp-brand-nodes {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.rp-brand-node {
    position: absolute;
    border-radius: 50%;
    animation: rp-float ease-in-out infinite;
}

.rp-brand-node:nth-child(1) { width: 5px; height: 5px; background: rgba(255, 140, 66, 0.45); top: 15%; left: 20%; animation-duration: 7s; }
.rp-brand-node:nth-child(2) { width: 3px; height: 3px; background: rgba(255, 182, 124, 0.30); top: 25%; right: 18%; animation-duration: 9s; animation-delay: 1s; }
.rp-brand-node:nth-child(3) { width: 6px; height: 6px; background: rgba(255, 140, 66, 0.38); bottom: 30%; left: 12%; animation-duration: 8s; animation-delay: 2s; }
.rp-brand-node:nth-child(4) { width: 4px; height: 4px; background: rgba(201, 94, 28, 0.40); top: 60%; right: 25%; animation-duration: 6s; animation-delay: 0.5s; }
.rp-brand-node:nth-child(5) { width: 8px; height: 8px; background: rgba(255, 140, 66, 0.22); bottom: 18%; right: 15%; animation-duration: 10s; animation-delay: 3s; }
.rp-brand-node:nth-child(6) { width: 4px; height: 4px; background: rgba(201, 94, 28, 0.38); top: 40%; left: 30%; animation-duration: 7.5s; animation-delay: 1.5s; }

.rp-brand-nodes svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* --- Pulse Rings --- */
.rp-pulse-rings {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-pulse-ring {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 1.5px solid rgba(255, 140, 66, 0.5);
    border-radius: 50%;
    animation: rp-pulse 3.5s ease-out infinite;
}

.rp-pulse-ring:nth-child(2) { animation-delay: 1.17s; }
.rp-pulse-ring:nth-child(3) { animation-delay: 2.33s; }

.rp-pulse-center {
    position: relative;
    width: 8px;
    height: 8px;
    background: rgba(255, 140, 66, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 140, 66, 0.5);
}

/* --- Animations --- */
@keyframes rp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

@keyframes rp-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rp-glow-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes rp-float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(6px, -10px); }
    50% { transform: translate(-4px, -6px); }
    75% { transform: translate(8px, 4px); }
}

@keyframes rp-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(3.5); opacity: 0; }
}

.rp-brand-content {
    animation: rp-fadeIn 0.6s ease;
}

/* --- Footer --- */
.rp-login-footer {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--rp-login-text-light);
    line-height: 1.6;
    padding: 20px 0 16px;
    flex-shrink: 0;
}

.rp-footer-main {
    margin-bottom: 4px;
}

.rp-version-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-family: var(--rp-font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--rp-login-primary);
    background: rgba(255, 140, 66, 0.10);
    border: 1px solid rgba(255, 140, 66, 0.20);
    border-radius: 4px;
    vertical-align: middle;
}

/* --- Trust badges (brand panel) --- */
.rp-brand-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid rgba(244, 237, 228, 0.07);
}

.rp-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(244, 237, 228, 0.42);
    font-family: var(--rp-font-body);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.rp-trust-badge svg {
    color: rgba(255, 140, 66, 0.55);
}

.rp-trust-divider {
    width: 1px;
    height: 14px;
    background: rgba(244, 237, 228, 0.10);
}

/* --- Override Frappe defaults op login-pagina --- */
body.rp-login-page .rp-btn-login.btn-primary {
    background: var(--rp-login-primary);
    color: #fffaf2;
    border: none;
    box-shadow: 0 1px 3px rgba(201, 94, 28, 0.3);
    margin-top: 0;
    font-size: 15px;
    padding: 14px 24px;
    border-radius: var(--rp-login-radius-sm);
}

body.rp-login-page .rp-btn-login.btn-primary:hover {
    background: var(--rp-login-primary-hover);
    box-shadow: 0 4px 14px rgba(201, 94, 28, 0.32);
}

body.rp-login-page .page-card {
    border: none;
    box-shadow: none;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

body.rp-login-page .page-card-head,
body.rp-login-page .page-card-body,
body.rp-login-page .page-card-actions {
    border: none;
    padding: 0;
    margin: 0;
}

body.rp-login-page .hero-and-content {
    background: transparent;
}

body.rp-login-page .container {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* 2FA-sectie standaard verborgen (Frappe verbergt alleen forgot/email-login) */
body.rp-login-page .for-verify,
body.rp-login-page .for-forgot,
body.rp-login-page .for-login-with-email-link {
    display: none;
}

/* Verberg Frappe's standaard-elementen */
body.rp-login-page .sign-up-message,
body.rp-login-page .login-divider,
body.rp-login-page .social-logins,
body.rp-login-page .web-footer {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .rp-login-wrapper {
        flex-direction: column;
        min-height: 100vh;
    }
    .rp-login-brand {
        flex: none;
        padding: 40px 32px 32px;
    }
    .rp-brand-features,
    .rp-brand-nodes,
    .rp-brand-trust {
        display: none;
    }
    .rp-brand-tagline {
        margin-bottom: 0;
    }
    .rp-pulse-rings {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }
    .rp-login-form-panel {
        flex: 1;
        padding: 32px 24px 0;
    }
    .rp-login-footer {
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    .rp-login-brand {
        padding: 24px 20px 20px;
    }
    .rp-brand-name {
        font-size: 32px;
    }
    .rp-brand-tagline {
        font-size: 14px;
    }
    .rp-pulse-rings {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }
    .rp-login-form-panel {
        padding: 24px 16px 0;
    }
    .rp-login-header h2 {
        font-size: 26px;
    }
    .rp-login-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    .rp-login-header {
        margin-bottom: 24px;
    }
    .rp-login-footer {
        padding: 12px 16px;
    }
    .rp-footer-main {
        font-size: 11px;
    }
}
