/**
 * FlowPath Messenger — Login & Frontend Base CSS
 * Mobile-First, DM Sans (Plugin-Konvention), Vanilla CSS
 *
 * @since 1.0.0
 * @updated 1.0.2 — Logo aspect-ratio + mittig + scroll-frei,
 *                  Passwort-Toggle, Passwort-vergessen-Modal
 */

/* DM Sans über Google Fonts laden — analog CRM-Konvention */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
    --fpc-msg-color-primary: #2c3e50;
    --fpc-msg-color-primary-hover: #1a2532;
    --fpc-msg-color-accent: #3498db;
    --fpc-msg-color-bg: #f5f6f8;
    --fpc-msg-color-card-bg: #ffffff;
    --fpc-msg-color-text: #2c3e50;
    --fpc-msg-color-text-muted: #7f8c8d;
    --fpc-msg-color-border: #e1e4e8;
    --fpc-msg-color-success: #27ae60;
    --fpc-msg-color-error: #e74c3c;
    --fpc-msg-color-info: #3498db;
    --fpc-msg-radius: 8px;
    --fpc-msg-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Reset minimal */
.fpc-msg-login-body * {
    box-sizing: border-box;
}

.fpc-msg-login-body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--fpc-msg-color-text);
    background: var(--fpc-msg-color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* WordPress Admin-Bar berücksichtigen */
.fpc-msg-login-body.admin-bar {
    padding-top: 32px;
}

/* Wrap — vertikal zentriert, scroll-frei wenn möglich */
.fpc-msg-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* Card */
.fpc-msg-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--fpc-msg-color-card-bg);
    border-radius: var(--fpc-msg-radius);
    box-shadow: var(--fpc-msg-shadow);
    padding: 28px 24px;
}

.fpc-msg-login-card h1,
.fpc-msg-login-card h2,
.fpc-msg-login-card h3 {
    color: var(--fpc-msg-color-text);
    margin: 0 0 14px 0;
    font-weight: 600;
}

.fpc-msg-login-card h1 { font-size: 24px; }
.fpc-msg-login-card h2 { font-size: 20px; text-align: center; }
.fpc-msg-login-card h3 { font-size: 16px; margin-top: 24px; }

/* =========================================================================
 * Logo / Branding — mittig zentriert, Aspect-Ratio erhalten
 * ========================================================================= */
.fpc-msg-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

.fpc-msg-logo img {
    max-width: 160px;
    max-height: 160px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.fpc-msg-brand {
    text-align: center;
    margin-bottom: 18px;
}

.fpc-msg-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* =========================================================================
 * Felder
 * ========================================================================= */
.fpc-msg-field {
    margin-bottom: 14px;
}

.fpc-msg-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--fpc-msg-color-text);
}

.fpc-msg-field input[type="email"],
.fpc-msg-field input[type="password"],
.fpc-msg-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;                       /* min 16px gegen Android-Zoom */
    font-family: inherit;
    color: var(--fpc-msg-color-text);      /* dunkelgrau gemäss Konvention */
    background: #fff;
    border: 1px solid var(--fpc-msg-color-border);
    border-radius: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fpc-msg-field input:focus {
    outline: none;
    border-color: var(--fpc-msg-color-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* =========================================================================
 * Passwort-Feld mit Auge-Toggle
 * ========================================================================= */
.fpc-msg-password-field {
    position: relative;
}

.fpc-msg-password-field input[type="password"],
.fpc-msg-password-field input[type="text"] {
    padding-right: 48px;                   /* Platz für Toggle-Button */
}

.fpc-msg-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--fpc-msg-color-text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
    padding: 0;
}

.fpc-msg-password-toggle:hover {
    color: var(--fpc-msg-color-primary);
    background: rgba(0, 0, 0, 0.04);
}

.fpc-msg-password-toggle:focus {
    outline: none;
    color: var(--fpc-msg-color-primary);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.fpc-msg-password-toggle svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
    display: block;
}

.fpc-msg-password-toggle .icon-eye-off {
    display: none;
}

.fpc-msg-password-toggle.is-visible .icon-eye {
    display: none;
}

.fpc-msg-password-toggle.is-visible .icon-eye-off {
    display: block;
}

/* =========================================================================
 * Checkbox-Field
 * ========================================================================= */
.fpc-msg-field-checkbox {
    margin-bottom: 16px;
}

.fpc-msg-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--fpc-msg-color-text-muted);
    cursor: pointer;
    user-select: none;
}

.fpc-msg-field-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* =========================================================================
 * Submit-Button
 * ========================================================================= */
.fpc-msg-btn-primary {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--fpc-msg-color-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.fpc-msg-btn-primary:hover:not(:disabled) {
    background: var(--fpc-msg-color-primary-hover);
}

.fpc-msg-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================================
 * Passwort-Vergessen-Link
 * ========================================================================= */
.fpc-msg-forgot {
    text-align: center;
    margin-top: 14px;
}

.fpc-msg-forgot-link {
    background: none;
    border: none;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--fpc-msg-color-text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    border-radius: 4px;
}

.fpc-msg-forgot-link:hover,
.fpc-msg-forgot-link:focus {
    color: var(--fpc-msg-color-primary);
    outline: none;
}

/* =========================================================================
 * Alerts
 * ========================================================================= */
.fpc-msg-alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 14px;
    border-left: 3px solid;
}

.fpc-msg-alert-success {
    background: #eafaf1;
    border-color: var(--fpc-msg-color-success);
    color: #1d6e3f;
}

.fpc-msg-alert-info {
    background: #ebf5fb;
    border-color: var(--fpc-msg-color-info);
    color: #1d4f6e;
}

.fpc-msg-alert-error {
    background: #fdedec;
    border-color: var(--fpc-msg-color-error);
    color: #8e2820;
}

/* =========================================================================
 * Footer
 * ========================================================================= */
.fpc-msg-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--fpc-msg-color-text-muted);
}

/* =========================================================================
 * Modal — Passwort-Vergessen-Hinweis
 * ========================================================================= */
.fpc-msg-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.fpc-msg-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.fpc-msg-modal {
    background: #fff;
    border-radius: var(--fpc-msg-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    padding: 24px;
    transform: translateY(8px);
    transition: transform 0.2s;
}

.fpc-msg-modal-backdrop.is-open .fpc-msg-modal {
    transform: translateY(0);
}

.fpc-msg-modal h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--fpc-msg-color-text);
}

.fpc-msg-modal p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--fpc-msg-color-text);
}

.fpc-msg-modal p:last-of-type {
    margin-bottom: 18px;
}

.fpc-msg-modal-actions {
    display: flex;
    justify-content: flex-end;
}

.fpc-msg-modal-close {
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--fpc-msg-color-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.fpc-msg-modal-close:hover,
.fpc-msg-modal-close:focus {
    background: var(--fpc-msg-color-primary-hover);
    outline: none;
}

/* Body-Scroll-Lock wenn Modal offen */
.fpc-msg-modal-open {
    overflow: hidden;
}

/* =========================================================================
 * Responsive
 * ========================================================================= */

/* Mobile-Phone Hochformat: Logo etwas kleiner */
@media (max-width: 480px) {
    .fpc-msg-login-card {
        padding: 22px 18px;
        max-width: 100%;
    }
    .fpc-msg-login-card h1 { font-size: 22px; }
    .fpc-msg-login-card h2 { font-size: 18px; }
    .fpc-msg-logo img {
        max-width: 130px;
        max-height: 130px;
    }
}

/* Querformat mit wenig Höhe (Tablet-Landscape, Phone-Landscape):
   Logo kompakter, Margins enger — alles auf einen Blick ohne Scrollen */
@media (max-height: 640px) {
    .fpc-msg-login-wrap {
        padding: 12px;
    }
    .fpc-msg-login-card {
        padding: 20px 22px;
    }
    .fpc-msg-logo {
        margin-bottom: 12px;
    }
    .fpc-msg-logo img {
        max-width: 90px;
        max-height: 90px;
    }
    .fpc-msg-login-card h2 {
        margin-bottom: 10px;
    }
    .fpc-msg-field {
        margin-bottom: 10px;
    }
    .fpc-msg-field-checkbox {
        margin-bottom: 12px;
    }
    .fpc-msg-footer {
        margin-top: 12px;
    }
}

/* Externer Modus (?ext=1) und Magic-Link-Landing Hinweis-Text */
.fpc-msg-ext-hint{font-size:13px;color:var(--fpc-msg-muted,#8B85A0);line-height:1.5;margin:0 0 14px;}
