/**
 * @package     PowerWareHouse.Component
 * @subpackage  Portal
 * 
 * @copyright   Copyright (C) 2026 - PowerWareHouse UG (Haftungsbeschränkt), All rights reserved.
 * @license     Commercial Private License version 1 or later; see LICENSE.txt
 * @author      André Harrweg
 */

/* General Authentication Layout */
/* 1. Body als Flexbox über mindestens die volle Viewport-Höhe */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 2. Haupt-Inhaltsbereich zwischen Header und Footer flexibel wachsen lassen */
.portal-card {
    width: min(92%, 600px);
    background: #ffffff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 30px;
    box-sizing: border-box;

    /* Vertikale Zentrierung mit harmonischem Minimalabstand: */
    margin: 60px auto 40px auto;
}

/* 3. Footer bleibt immer ganz unten stehen */
.pw-portal-footer {
    margin-top: auto; /* Schiebt den Footer immer an den unteren Rand des Viewports */
}

.portal-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 24px;
    color: #1a1a1a;
    text-align: center;
}

.portal-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-top: -16px; /* Pull up closer to h3 */
    margin-bottom: 24px;
    line-height: 1.4;
}

/* Form Groups & Inputs */
.portal-form-group {
    margin-bottom: 16px;
    position: relative; /* Necessary for password toggle button */
}

.portal-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.portal-form-group input[type="text"],
.portal-form-group input[type="email"],
.portal-form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out;
}

.portal-form-group input:focus {
    border-color: #0d6efd;
    outline: 0;
}

/* Primary Button */
.btn-portal-primary {
    width: 100%;
    padding: 10px;
    background-color: #0d6efd;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}

.btn-portal-primary:hover {
    background-color: #0b5ed7;
}

/* Links Section */
.portal-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.portal-links.border-top {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.portal-links a,
.portal-link-subtle {
    color: #0d6efd;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.portal-links a:hover,
.portal-link-subtle:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

.portal-link-subtle {
    color: #64748b;
    margin-bottom: 16px;
}
.portal-link-subtle:hover {
    color: #1e293b;
}

/* Checkbox specific to login */
.portal-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: #495057;
}

/* Login specific divider & secondary button */
.portal-divider {
    position: relative;
    text-align: center;
    margin: 16px 0;
}

.portal-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e2e8f0;
    z-index: 1;
}

.portal-divider span {
    position: relative;
    z-index: 2;
    background-color: #ffffff;
    padding: 0 12px;
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-portal-secondary {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.btn-portal-secondary:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Registration specific elements */
.field-error-msg {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

input.invalid-field {
    border-color: #dc2626 !important;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 38px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    padding: 0;
    z-index: 5;
}