/* ==========================================================================
   40. LOGIN PAGE STYLES
   ========================================================================== */

:root {
    --am-primary: #2196F3;
    --am-primary-dark: #1565C0;
    --am-accent: #00BCD4;
    --am-gradient: linear-gradient(135deg, #2196F3, #00BCD4);
    --login-radius: 20px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    background: #0B1120;
}

/* -- Left Side: Visual / Branding -- */
.login-visual {
    flex: 0 0 420px;
    max-width: 420px;
    background: var(--am-gradient);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    overflow: hidden;
}

.login-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0,188,212,0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(33,150,243,0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 70%);
}

/* Animated mesh grid */
.mesh-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: meshMove 25s linear infinite;
}

@keyframes meshMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* Floating orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
    width: 300px; height: 300px;
    background: rgba(0,188,212,0.2);
    top: -50px; left: -50px;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px; height: 200px;
    background: rgba(33,150,243,0.15);
    bottom: 10%; right: -30px;
    animation-delay: -3s;
    animation-duration: 10s;
}

.orb-3 {
    width: 150px; height: 150px;
    background: rgba(255,255,255,0.05);
    top: 40%; left: 20%;
    animation-delay: -5s;
    animation-duration: 12s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.visual-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 440px;
}

.visual-logo {
    margin-bottom: 2rem;
}

.visual-logo {
    margin-bottom: 0;
}

.visual-logo img {
    width: 95%;
    max-height: 100%;
    height: auto;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.15));
}

.visual-tagline {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.visual-subtitle {
    font-size: 1rem;
    opacity: 0.75;
    line-height: 1.6;
    font-weight: 400;
}

/* Feature pills */
.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    justify-content: center;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: #F0F7FF;
    border: 1px solid #DBEAFE;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--am-primary);
}

[data-theme="dark"] .feature-pill {
    background: rgba(33,150,243,0.1);
    border-color: rgba(33,150,243,0.2);
}

.feature-pill i {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* -- Right Side: Form -- */
.login-form-side {
    flex: 1;
    min-width: 440px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    background: #fff;
    position: relative;
}

[data-theme="dark"] .login-form-side {
    background: #111827;
}

.form-wrapper {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}

.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A2332;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

[data-theme="dark"] .form-header h1 {
    color: #F1F5F9;
}

.form-header p {
    color: #64748B;
    font-size: 0.92rem;
}

[data-theme="dark"] .form-header p {
    color: #94A3B8;
}

/* Form fields */
.field {
    margin-bottom: 1.35rem;
}

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
}

[data-theme="dark"] .field-label {
    color: #D1D5DB;
}

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

.field-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #1A2332;
    background: #F8FAFC;
    outline: none;
    transition: all 0.2s ease;
}

[data-theme="dark"] .field-input {
    background: #1E293B;
    border-color: #334155;
    color: #F1F5F9;
}

.field-input::placeholder {
    color: #94A3B8;
}

.field-input:focus {
    border-color: var(--am-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.1);
}

[data-theme="dark"] .field-input:focus {
    background: #1E293B;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}

.field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 0.88rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.field-input:focus ~ .field-icon {
    color: var(--am-primary);
}

/* Options row */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-check input {
    width: 16px; height: 16px;
    accent-color: var(--am-primary);
    cursor: pointer;
}

.remember-check span {
    font-size: 0.84rem;
    color: #64748B;
}

[data-theme="dark"] .remember-check span {
    color: #94A3B8;
}

.forgot-link {
    font-size: 0.84rem;
    color: var(--am-primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--am-gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(33,150,243,0.35);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.submit-btn:hover::after {
    transform: translateX(100%);
}

/* Error */
.login-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    color: #DC2626;
    animation: errorShake 0.4s ease;
}

[data-theme="dark"] .login-error {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.3);
    color: #FCA5A5;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E2E8F0;
}

[data-theme="dark"] .login-footer {
    border-color: #334155;
}

.login-footer p {
    font-size: 0.78rem;
    color: #94A3B8;
    line-height: 1.5;
}

/* Theme toggle */
/* Top actions container (lang + theme) */
.login-top-actions {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.theme-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .theme-btn {
    border-color: #334155;
    background: #1E293B;
    color: #F59E0B;
}

.theme-btn:hover {
    border-color: var(--am-primary);
    color: var(--am-primary);
}

/* Language dropdown on login */
.login-lang-dropdown {
    position: relative;
}

.login-lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #64748B;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.login-lang-toggle .lang-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.login-lang-toggle i {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.login-lang-dropdown.open .login-lang-toggle i {
    transform: rotate(180deg);
}

.login-lang-toggle:hover {
    border-color: var(--am-primary);
    color: var(--am-primary);
}

[data-theme="dark"] .login-lang-toggle {
    border-color: #334155;
    background: #1E293B;
    color: #94A3B8;
}

.login-lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 160px;
    max-height: 360px;
    overflow-y: auto;
}

[data-theme="dark"] .login-lang-menu {
    background: #1E293B;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.login-lang-dropdown.open .login-lang-menu {
    display: block;
}

.login-lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: #475569;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}

.login-lang-option:hover {
    background: #F1F5F9;
}

[data-theme="dark"] .login-lang-option {
    color: #CBD5E1;
}

[data-theme="dark"] .login-lang-option:hover {
    background: #334155;
}

.login-lang-option.active {
    color: var(--am-primary);
    font-weight: 600;
}

.login-lang-option .lang-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

/* -- Responsive -- */
@media (max-width: 900px) {
    body {
        flex-direction: column;
        overflow: auto;
        min-height: 100vh;
        height: auto;
    }

    .login-visual {
        flex: 0 0 auto;
        max-width: 100%;
        min-height: 200px;
        padding: 2rem 1.5rem;
    }

    .visual-logo img {
        width: 60%;
        max-width: 240px;
        height: auto;
    }

    .login-form-side {
        width: 100%;
        min-width: 0;
        min-height: auto;
        flex: 1;
        padding: 2rem 1.5rem;
        border-radius: var(--login-radius) var(--login-radius) 0 0;
        margin-top: -20px;
        position: relative;
        z-index: 5;
    }

    .form-wrapper {
        max-width: 100%;
    }

    .feature-pills {
        display: none;
    }

    .login-top-actions {
        top: 1rem;
        right: 1rem;
    }
    .login-lang-toggle span {
        display: none;
    }
    .login-lang-toggle i {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-visual {
        min-height: 160px;
        padding: 1.5rem 1rem;
    }

    .visual-logo img {
        width: 50%;
        max-width: 180px;
    }

    .login-form-side {
        padding: 1.5rem 1.25rem;
    }

    .form-header h1 {
        font-size: 1.25rem;
    }

    .form-header p {
        font-size: 0.85rem;
    }

    .field-input {
        padding: 0.7rem 0.85rem 0.7rem 2.5rem;
        font-size: 0.88rem;
    }

    .submit-btn {
        padding: 0.75rem;
        font-size: 0.92rem;
    }

    .options-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .login-footer {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* ── 37. CASH TRACKING PAGE STYLES ── */
.cash-tracking-container {
    padding: 2rem;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.device-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.device-card:hover {
    box-shadow: var(--shadow-md);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.device-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.device-balance {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-success);
}

.device-balance.empty {
    color: var(--text-muted);
}

.device-info {
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.device-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.device-actions .btn {
    flex: 1;
    font-size: 0.875rem;
}

/* Modals use global styles from app.css */
.modal-content.wide {
    max-width: 700px;
}

.cash-input-group {
    margin-bottom: 1rem;
}

.cash-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.denomination-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.denomination-input {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.denomination-input label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.denomination-input input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    background: var(--bg-card);
    color: var(--text-primary);
}

.section-divider {
    margin: 1.5rem 0;
    border: 0;
    border-top: 2px solid var(--border-color);
}

.breakdown-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.breakdown-table th,
.breakdown-table td {
    padding: 0.875rem 1rem;
    text-align: left;
}

.breakdown-table th {
    background: var(--am-primary);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-table tbody tr {
    background: var(--bg-card);
    transition: all 0.2s;
}

.breakdown-table tbody tr:nth-child(even) {
    background: var(--bg-muted);
}

.breakdown-table tbody tr:hover {
    background: color-mix(in srgb, var(--am-primary) 8%, transparent);
}

.breakdown-table tbody tr:last-child {
    background: var(--bg-muted);
    font-weight: 700;
}

.emptying-history {
    margin-top: 0.5rem;
}

.emptying-entry {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--am-primary);
    transition: all 0.2s;
}

.emptying-entry:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.emptying-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.emptying-entry-header span:last-child {
    background: var(--am-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.emptying-entry-details {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Tabs für Details Modal */
.details-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-muted);
    padding: 0.375rem;
    border-radius: 12px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s;
    flex: 1;
    font-weight: 500;
}

.tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--am-primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn i {
    margin-right: 0.375rem;
}

.tab-content {
    min-height: 200px;
}

.tab-content h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-content h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--am-primary);
    border-radius: 2px;
}

/* Scrollbare Münz-Historie */
.coin-history-scroll {
    max-height: 350px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.coin-history-scroll::-webkit-scrollbar {
    width: 6px;
}

.coin-history-scroll::-webkit-scrollbar-track {
    background: var(--bg-muted);
    border-radius: 3px;
}

.coin-history-scroll::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}

.coin-history-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.coin-history-scroll table {
    margin: 0;
}

.coin-history-scroll thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.coin-history-scroll tbody tr:hover {
    background: color-mix(in srgb, var(--am-primary) 8%, transparent) !important;
}

/* .status-badge defined in app.css */

.status-badge.current {
    background: linear-gradient(135deg, var(--color-success) 0%, color-mix(in srgb, var(--color-success) 80%, black));
    color: white;
}

.status-badge.emptied {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

/* Cash comparison section */
.cash-comparison-section {
    background: var(--bg-muted);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.cash-comparison-section h4 {
    margin: 0 0 1rem 0;
    color: var(--am-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cash-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.cash-comparison-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.cash-comparison-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cash-comparison-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--am-primary);
}

.cash-comparison-input {
    font-size: 1.5rem;
    padding: 0.5rem;
    border: 2px solid var(--am-primary);
    border-radius: 8px;
    width: 100%;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
}

.cash-difference-row {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.cash-difference-row .diff-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cash-difference-row .diff-label {
    font-weight: 600;
    color: var(--text-muted);
}

.cash-difference-row .diff-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.cash-comparison-hint {
    color: var(--text-secondary);
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

/* Modal form controls */
.modal-form-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.modal-form-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-form-hint {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.375rem;
    display: block;
}

/* Modal action buttons row */
.modal-actions {
    margin-top: 1.75rem;
    display: flex;
    gap: 0.75rem;
}

/* Modal loading state */
.modal-loading-state {
    text-align: center;
    padding: 3rem 2rem;
}

.modal-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--am-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Modal result states */
.modal-result-center {
    text-align: center;
    padding: 1rem;
}

.modal-result-icon {
    margin-bottom: 1rem;
}

.modal-result-box {
    background: var(--bg-muted);
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
}

.modal-result-box.bordered {
    border-left: 4px solid var(--color-info);
}

.modal-result-box.warning-bordered {
    background: color-mix(in srgb, var(--color-warning) 15%, var(--bg-card));
    border-left: 4px solid var(--color-warning);
}

.modal-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
