/**
 * Markenportal - Login Page Styles
 * Gemeinsame Styles für alle Login-Seiten:
 * - login.php
 * - 2fa.php
 * - erster-login.php
 * - passwort-vergessen.php
 * - passwort-reset.php
 */

/* ─── Base ──────────────────────────────────────────────────────────── */
html, body {
    height: 100%;
    overflow: auto;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Brand gradient background */
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 0, 80, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(250, 155, 210, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 0, 80, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: gradient-shift 20s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-2%, 2%) rotate(-1deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* ─── Header ────────────────────────────────────────────────────────── */
.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 0 40px var(--brand-red-glow)) drop-shadow(0 0 80px var(--brand-red-glow));
    animation: signet-pulse 3s ease-in-out infinite;
}

.login-logo.login-logo-lg {
    width: 120px;
    height: 120px;
}

@keyframes signet-pulse {
    0%, 100% { filter: drop-shadow(0 0 40px var(--brand-red-glow)) drop-shadow(0 0 80px var(--brand-red-glow)); }
    50% { filter: drop-shadow(0 0 50px var(--brand-red-glow)) drop-shadow(0 0 100px rgba(255, 0, 80, 0.5)); }
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-title {
    font-family: 'ReutlingenSans', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.login-title strong {
    font-weight: 700;
    color: var(--brand-red);
}

.login-version {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ─── Card ──────────────────────────────────────────────────────────── */
.login-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

/* ─── Messages ──────────────────────────────────────────────────────── */
.login-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-message svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.login-message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.login-message-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #fbbf24;
}

.login-message-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.login-message-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

/* ─── Form ──────────────────────────────────────────────────────────── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition);
}

/* Login Input Styles - Überschreibt Browser-Defaults */
.login-form .input-wrapper input,
.login-form .input-wrapper input[type="email"],
.login-form .input-wrapper input[type="password"],
.login-form .input-wrapper input[type="text"] {
    width: 100%;
    height: auto;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-family: 'Abel', sans-serif;
    font-size: 1rem;
    background: #333333;
    background: var(--bg-input, #333333);
    border: 1px solid #3a3a3a;
    border: 1px solid var(--border, #3a3a3a);
    border-radius: 6px;
    border-radius: var(--radius-md, 6px);
    color: #ffffff;
    color: var(--text-primary, #ffffff);
    transition: all 0.15s ease;
    transition: all var(--transition, 0.15s ease);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

/* Autofill-Styles überschreiben (Chrome, Safari) */
.login-form .input-wrapper input:-webkit-autofill,
.login-form .input-wrapper input:-webkit-autofill:hover,
.login-form .input-wrapper input:-webkit-autofill:focus,
.login-form .input-wrapper input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #333333 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid #3a3a3a !important;
    transition: background-color 5000s ease-in-out 0s;
}

.login-form .input-wrapper input:hover {
    border-color: #4a4a4a;
    border-color: var(--border-hover, #4a4a4a);
}

.login-form .input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 0 20px rgba(59, 130, 246, 0.3);
}

.input-wrapper input:focus + svg,
.input-wrapper:focus-within svg {
    color: var(--accent, #3b82f6);
}

.login-form .input-wrapper input::placeholder {
    color: #707070;
    color: var(--text-muted, #707070);
}

/* ─── Code Input (2FA, Erster Login) ────────────────────────────────── */
.code-input {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Individual code boxes */
.code-input-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

input[type="text"].code-input-box {
    width: 48px;
    height: 72px;
    text-align: center;
    font-family: 'Abel', sans-serif;
    font-size: 1.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

input[type="text"].code-input-box:hover {
    border-color: var(--border-hover);
}

input[type="text"].code-input-box:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted), 0 0 20px rgba(59, 130, 246, 0.3);
}

/* ─── Button ────────────────────────────────────────────────────────── */
.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-top: 0.25rem;
    font-family: 'Abel', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.login-button:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.login-button:active {
    transform: scale(0.98);
}

.login-button svg {
    width: 18px;
    height: 18px;
}

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Secondary / Ghost button */
.login-button-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.login-button-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    box-shadow: none;
}

/* ─── Links ─────────────────────────────────────────────────────────── */
.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.login-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.login-link:hover {
    color: var(--accent);
}

.login-link svg {
    width: 14px;
    height: 14px;
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--accent);
}

/* ─── Resolution Warning ────────────────────────────────────────────── */
.resolution-warning {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.98);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.resolution-warning-content {
    max-width: 400px;
}

.resolution-warning svg {
    width: 64px;
    height: 64px;
    color: var(--brand-red);
    margin-bottom: 1.5rem;
}

.resolution-warning h2 {
    font-family: 'ReutlingenSans', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.resolution-warning p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── Password Requirements ─────────────────────────────────────────── */
.password-requirements {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.5rem;
}

.password-requirements-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.password-requirements-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.password-requirement svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.password-requirement.valid {
    color: var(--success);
}

.password-requirement.valid svg {
    color: var(--success);
}

/* ─── Steps Indicator ───────────────────────────────────────────────── */
.login-steps,
.steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.login-step,
.step {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: all 0.2s ease;
}

.login-step.active,
.step.active {
    background: var(--accent);
}

.login-step.completed,
.step.done {
    background: var(--success);
}

/* ─── Timer / Resend ────────────────────────────────────────────────── */
.code-timer {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.code-timer strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.resend-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8125rem;
}

.resend-link:hover {
    text-decoration: underline;
}

.resend-link:disabled,
.resend-link.disabled {
    color: var(--text-muted);
    pointer-events: none;
}

/* ─── Captcha ───────────────────────────────────────────────────────── */
.captcha-wrapper {
    margin-top: 1rem;
}

.captcha-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
