@font-face {
    font-family: 'Charles Wright Bold';
    font-style: normal;
    font-weight: normal;
    src: local('Charles Wright Bold'), url('../fonts/CharlesWright-Bold.woff') format('woff');
    font-display: swap;
}

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

html {
    /* Prevent iOS Safari from adjusting viewport */
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    /* Fix for iOS Safari viewport issues */
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 650px;
}

.plate-container {
    background: #FFD900;
    border: 4px solid #000;
    border-radius: 6px;
    box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.3),
            inset 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: stretch;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    min-height: 90px;
}

/* UK Flag and GB Section */
.uk-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #003399;
    padding: 10px 8px;
    border-right: 2px solid #000;
    min-width: 50px;
    flex-shrink: 0;
}

.uk-flag {
    width: 32px;
    height: 24px;
    position: relative;
    background: #003399;
    margin-bottom: 4px;
}

/* Union Jack flag styling */
.uk-flag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
            linear-gradient(to bottom, transparent 40%, white 40%, white 60%, transparent 60%),
            linear-gradient(to right, transparent 40%, white 40%, white 60%, transparent 60%);
}

.uk-flag::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
            linear-gradient(to bottom, transparent 45%, #C8102E 45%, #C8102E 55%, transparent 55%),
            linear-gradient(to right, transparent 45%, #C8102E 45%, #C8102E 55%, transparent 55%),
            linear-gradient(45deg, transparent 48%, white 48%, white 52%, transparent 52%),
            linear-gradient(-45deg, transparent 48%, white 48%, white 52%, transparent 52%);
}

.gb-text {
    color: white;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Input section */
.input-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 25px;
    background: #FFD900;
}

.plate-input {
    background: transparent;
    border: none;
    font-size: clamp(32px, 6vw, 56px);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 8px;
    padding: 0;
    outline: none;
    color: #000;
    font-family: 'Charles Wright Bold', 'Trebuchet MS', 'Arial Narrow', Arial, sans-serif;
    text-align: center;
    width: 100%;
    -webkit-text-stroke: 0.5px #000;
}

.plate-input::placeholder {
    color: #666;
    opacity: 0.5;
}

/* Search button */
.search-button {
    background: #003399;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.search-button:hover {
    background: #0044bb;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.search-button:active {
    transform: translateY(0);
}

/* Info text */
.info-text {
    text-align: center;
    color: white;
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.info-text a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.info-text a:hover {
    opacity: 0.7;
}

.footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #667eea;
    font-size: 14px;
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Corner Banner */
.corner-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
    z-index: 1000;
    pointer-events: none;
}

.corner-banner-text {
    position: absolute;
    top: 32px;
    left: -37px;
    width: 200px;
    background: #10b981;
    color: white;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 8px 0;
    transform: rotate(-45deg);
    transform-origin: center center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
    color: #333;
    line-height: 1.6;
}

.modal-body p {
    margin: 0 0 15px 0;
}

.modal-body ul {
    margin: 10px 0 20px 20px;
    padding: 0;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-body strong {
    color: #003399;
}

/* Verification Error Modal */
#verificationErrorModal .modal-content {
    max-width: 440px;
}

#verificationErrorModal .modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

#verificationErrorModal .modal-body p {
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

#verificationErrorModal .modal-body ul {
    margin: 0 0 16px 24px;
    padding: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.8;
}

#verificationErrorModal .modal-body ul li {
    margin-bottom: 6px;
}

#verificationErrorModal .modal-body p:last-child {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    color: #1f2937;
}

/* Loading Screen */
.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-orb-container {
    text-align: center;
}

.loading-orb {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.orb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

.orb-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
}

.orb-ring-1 {
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}

.orb-ring-2 {
    width: 90px;
    height: 90px;
    animation: spin 2s linear infinite reverse;
}

.orb-ring-3 {
    width: 120px;
    height: 120px;
    animation: spin 2.5s linear infinite;
}

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

.loading-text {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Announcement Banner */
.announcement {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 15px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.announcement.good-news {
    background: #10b981;
    color: white;
}

.announcement.bad-news {
    background: #ef4444;
    color: white;
}

.announcement-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.announcement-message {
    font-size: 13px;
    opacity: 0.95;
}

/* Login Button */
.login-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1001;
}

.login-button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.login-button:active {
    transform: translateY(0);
}

.login-button svg {
    flex-shrink: 0;
}

/* Login Form Styles */
.login-modal-content {
    max-width: 450px;
}

/* Message Boxes */
.message-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-message {
    background: #d1fae5;
    border: 2px solid #10b981;
    color: #065f46;
}

.error-message {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.message-box strong {
    display: block;
    margin-bottom: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.form-remember {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: -5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Turnstile Widget Container */
#loginTurnstile {
    display: flex;
    justify-content: center;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #5568d3;
}

.login-submit-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-submit-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #999;
    font-size: 14px;
    margin: 10px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.login-divider span {
    padding: 0 15px;
}

.login-footer {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.signup-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: #5568d3;
}

/* Login Signup Prompt - Bigger CTA */
.login-signup-prompt {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    margin-top: 5px;
}

.login-signup-prompt p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 15px;
}

.signup-prompt-button {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.signup-prompt-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 2FA Step Styles */
.twofa-step {
    text-align: center;
}

.twofa-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.twofa-step h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
}

.twofa-instructions {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.twofa-code-input {
    text-align: center;
    font-size: 28px;
    letter-spacing: 6px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.back-to-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: none;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 12px 20px;
    margin-top: 10px;
    transition: color 0.2s ease;
    width: 100%;
}

.back-to-login-btn:hover {
    color: #5568d3;
}

/* Forgot Password Styles */
.forgot-instructions {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .plate-container {
        min-height: 70px;
    }

    .uk-section {
        min-width: 42px;
        padding: 8px 6px;
    }

    .uk-flag {
        width: 28px;
        height: 20px;
    }

    .gb-text {
        font-size: 9px;
    }

    .input-section {
        padding: 15px 18px;
    }

    .plate-input {
        letter-spacing: 6px;
    }

    .search-button {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Mobile login button */
    .login-button {
        top: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 14px;
        gap: 6px;
    }

    .login-button-text {
        display: inline;
    }

    /* Mobile login modal */
    .login-modal-content {
        margin: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .form-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

@media (max-width: 380px) {
    .plate-container {
        min-height: 60px;
    }

    .input-section {
        padding: 12px 15px;
    }

    .plate-input {
        letter-spacing: 4px;
    }

    .uk-section {
        min-width: 36px;
    }

    /* Extra small screens - icon only login button */
    .login-button {
        padding: 10px;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        justify-content: center;
    }

    .login-button-text {
        display: none;
    }

    .form-remember {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ========================================
   Signup Promotion
   ======================================== */
.signup-promotion {
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.signup-text {
    margin: 0 0 16px 0;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.signup-button {
    display: inline-block;
    padding: 14px 32px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.signup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

@media (max-width: 600px) {
    .signup-promotion {
        padding: 20px 16px;
        margin-top: 24px;
    }

    .signup-text {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .signup-button {
        padding: 12px 24px;
        font-size: 15px;
    }
}
