/* ==========================================================================
   Jonkler Truck — Apple White Luxury Aesthetic Stylesheet
   ========================================================================== */

:root {
    --bg-primary: #F5F5F7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-muted: #A1A1A6;
    --apple-blue: #0071E3;
    --apple-blue-hover: #0077ED;
    --apple-green: #34C759;
    --apple-red: #FF3B30;
    --apple-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --ticket-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Ambient Background Lights */
.ambient-light {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.light-1 {
    top: -100px;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.12) 0%, rgba(255,255,255,0) 70%);
}

.light-2 {
    bottom: -150px;
    right: 15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(52, 199, 89, 0.08) 0%, rgba(255,255,255,0) 70%);
}

/* Apple Top Navigation */
.apple-header {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(245, 245, 247, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.apple-nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apple-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.truck-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}

.brand-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-sub {
    font-weight: 400;
    color: var(--apple-blue);
    margin-left: 3px;
}

.apple-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--card-border);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--apple-green);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(52, 199, 89, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

/* Main Container */
.jonkler-main-container {
    position: relative;
    z-index: 1;
    max-width: 580px;
    margin: 40px auto;
    padding: 0 20px 60px 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 35px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--apple-blue);
    background: rgba(0, 113, 227, 0.08);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.45;
    max-width: 460px;
    margin: 0 auto;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--apple-shadow);
    padding: 36px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden {
    display: none !important;
}

/* Loader Inside Card */
.card-loader {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.apple-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0, 113, 227, 0.15);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    margin: 0 auto 16px auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Styles */
.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.form-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 22px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.input-group input {
    width: 100%;
    padding: 16px 18px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.input-group input:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.input-with-hint {
    position: relative;
}

.input-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Error Box */
.error-msg-box {
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.2);
    color: var(--apple-red);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 22px;
    animation: shakeError 0.4s ease;
}

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

/* Buttons */
.apple-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(180deg, #0077ED 0%, #0071E3 100%);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.25);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 113, 227, 0.35);
}

.apple-button:active {
    transform: translateY(1px);
}

.apple-download-btn {
    background: linear-gradient(180deg, #34C759 0%, #28A745 100%) !important;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.25) !important;
    margin-bottom: 12px;
}

.apple-download-btn:hover {
    box-shadow: 0 12px 26px rgba(40, 167, 69, 0.35) !important;
}

.apple-button-secondary {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.apple-button-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Ticket View */
.ticket-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(52, 199, 89, 0.1);
    color: #278a3d;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--apple-green);
    border-radius: 50%;
}

.device-lock-badge {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
    padding: 6px 12px;
    border-radius: 20px;
}

/* Luxury Holographic Ticket Card */
.luxury-ticket {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--ticket-shadow);
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
}

.ticket-header-strip {
    background: linear-gradient(90deg, #1D1D1F 0%, #3A3A3C 100%);
    color: #FFFFFF;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.ticket-class {
    color: #F2D06B;
}

.ticket-body {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.qr-container {
    padding: 16px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

#qrcode-target canvas, #qrcode-target img {
    display: block;
    width: 180px !important;
    height: 180px !important;
}

.ticket-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    padding-top: 20px;
}

.ticket-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.field-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.code-highlight {
    font-family: monospace;
    background: rgba(0, 113, 227, 0.08);
    color: var(--apple-blue);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.emil-approved {
    color: #278a3d;
}

.ticket-footer-strip {
    background: #F5F5F7;
    padding: 14px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ticket-instructions {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
}

/* Footer */
.apple-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .jonkler-main-container {
        padding: 0 16px 40px 16px;
    }
    .glass-card {
        padding: 24px 20px;
    }
    .hero-title {
        font-size: 30px;
    }
    .ticket-body {
        padding: 20px 16px;
    }
}
