/* Custom Company Font */
@font-face {
    font-family: 'CervoNeue';
    src: url('../fonts/Typoforge Studio - CervoNeue-BlackNeue.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Theme variables are now defined in theme.css */
:root {
    --berry-white: #ffffff;

    --valid-green: #10b981;
    --valid-green-light: #d1fae5;
    --valid-green-dark: #059669;

    --invalid-red: #ef4444;
    --invalid-red-light: #fee2e2;
    --invalid-red-dark: #dc2626;

    --error-orange: #f59e0b;
    --error-orange-light: #fef3c7;

    --warning-yellow: #eab308;
    --warning-yellow-light: #fef9c3;
    --warning-yellow-dark: #ca8a04;

    --disabled-gray: #6b7280;
    --disabled-gray-light: #f3f4f6;
    --disabled-gray-dark: #4b5563;

    --font-primary: 'CervoNeue', 'Poppins', sans-serif;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--brand-bg) 0%, var(--brand-bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--brand-text-dark);
}

/* Header */
.validate-header {
    background: rgba(var(--brand-primary-rgb), 0.4);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(var(--brand-primary-rgb), 0.2);
}

.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.header-logo {
    height: 80px;
    width: 80px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

/* Main Content */
.validate-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Scanner View */
.scanner-view {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.scanner-view h1 {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.scanner-view .subtitle {
    color: var(--brand-text-light);
    margin-bottom: 2rem;
}

.qr-scanner {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(var(--brand-primary-rgb), 0.2);
}

.qr-scanner video {
    border-radius: 16px;
}

.manual-input {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--brand-primary-20);
}

.manual-input p {
    color: var(--brand-text-light);
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.input-group input {
    flex: 1;
    max-width: 300px;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--brand-primary-20);
    border-radius: 50px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    background: var(--berry-white);
    color: var(--brand-text-dark);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-primary-20);
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.input-group button:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
}

.scanner-error {
    margin-top: 1rem;
    color: var(--invalid-red);
    font-size: 0.9rem;
}

.reset-details-btn {
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--brand-text-light);
    border: 1px solid var(--brand-primary-20);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-details-btn:hover {
    background: var(--brand-primary-20);
    color: var(--brand-primary);
}

/* Loading View */
.loading-view {
    display: none;
    text-align: center;
}

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

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

/* Result Views (shared styles) */
.result-view {
    display: none;
    text-align: center;
    max-width: 450px;
    width: 100%;
    background: var(--berry-white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(var(--brand-primary-rgb), 0.2);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.result-header h2 {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.result-icon {
    font-size: 2rem;
    font-weight: bold;
}

.result-content {
    padding: 2rem;
}

/* Valid View */
.valid-header {
    background: linear-gradient(135deg, var(--valid-green) 0%, var(--valid-green-dark) 100%);
    color: white;
}

.valid-view .result-icon {
    background: white;
    color: var(--valid-green);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 1.5rem;
    border: 5px solid var(--valid-green);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.result-name {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.result-title {
    font-size: 1.1rem;
    color: var(--brand-text-dark);
    margin-bottom: 0.25rem;
}

.result-department {
    font-size: 1rem;
    color: var(--brand-text-light);
    margin-bottom: 0.25rem;
}

.result-company {
    font-size: 1rem;
    color: var(--brand-primary-light);
    font-weight: 600;
    margin-bottom: 1rem;
}

.result-contact {
    background: var(--valid-green-light);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.result-contact p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* Warning View (No Photo) */
.warning-header {
    background: linear-gradient(135deg, var(--warning-yellow) 0%, var(--warning-yellow-dark) 100%);
    color: white;
}

.warning-view .result-icon {
    background: white;
    color: var(--warning-yellow-dark);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.warning-icon-large {
    font-size: 5rem;
    color: var(--warning-yellow);
    margin-bottom: 1rem;
}

.warning-message {
    background: var(--warning-yellow-light);
    border: 2px solid var(--warning-yellow);
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
}

.warning-message p {
    margin: 0.5rem 0;
    color: var(--warning-yellow-dark);
}

.warning-contact {
    background: var(--warning-yellow-light);
}

/* Agency Staff Badge */
.agency-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Disabled Account View */
.disabled-header {
    background: linear-gradient(135deg, var(--invalid-red) 0%, var(--invalid-red-dark) 100%);
    color: white;
}

.disabled-view .result-icon {
    background: white;
    color: var(--invalid-red);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.disabled-message {
    font-size: 1.2rem;
    color: var(--invalid-red-dark);
    font-weight: 600;
    margin-bottom: 1rem;
}

.disabled-user-name {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}

.disabled-submessage {
    font-size: 0.95rem;
    color: var(--brand-text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Contact Support Box (shared) */
.contact-support {
    background: var(--invalid-red-light);
    border: 2px solid var(--invalid-red);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}

.contact-support p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--invalid-red-dark);
}

/* Invalid View */
.invalid-header {
    background: linear-gradient(135deg, var(--invalid-red) 0%, var(--invalid-red-dark) 100%);
    color: white;
}

.invalid-view .result-icon {
    background: white;
    color: var(--invalid-red);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invalid-message {
    font-size: 1.2rem;
    color: var(--invalid-red);
    font-weight: 600;
    margin-bottom: 1rem;
}

.invalid-submessage {
    font-size: 0.95rem;
    color: var(--brand-text-light);
    line-height: 1.6;
}

/* Error View */
.error-header {
    background: linear-gradient(135deg, var(--error-orange) 0%, #d97706 100%);
    color: white;
}

.error-view .result-icon {
    background: white;
    color: var(--error-orange);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-message {
    font-size: 1.1rem;
    color: var(--brand-text-dark);
    line-height: 1.6;
}

/* Scan Again Button */
.scan-again-btn {
    display: block;
    width: calc(100% - 4rem);
    margin: 0 2rem 2rem;
    padding: 1rem;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.scan-again-btn:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--brand-primary-rgb), 0.3);
}

/* Footer */
.validate-footer {
    text-align: center;
    padding: 1rem;
    color: var(--brand-text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    .validate-header {
        padding: 0.75rem 1rem;
    }

    .header-logo {
        height: 60px;
        width: 60px;
    }

    .header-logos {
        gap: 1rem;
    }

    .validate-main {
        padding: 1rem;
    }

    .scanner-view h1 {
        font-size: 1.6rem;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group input {
        max-width: none;
    }

    .result-view {
        border-radius: 16px;
    }

    .result-header h2 {
        font-size: 1.4rem;
    }

    .result-content {
        padding: 1.5rem;
    }

    .result-photo {
        width: 120px;
        height: 120px;
    }

    .result-name {
        font-size: 1.3rem;
    }

    .scan-again-btn {
        width: calc(100% - 3rem);
        margin: 0 1.5rem 1.5rem;
    }
}

/* Registration Modal */
.registration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.registration-content {
    background: var(--berry-white);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(var(--brand-primary-rgb), 0.3);
}

.registration-content h2 {
    color: var(--brand-primary);
    font-family: var(--font-primary);
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.registration-content > p {
    color: var(--brand-text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
}

.reg-form-group {
    margin-bottom: 1.25rem;
}

.reg-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--brand-text-dark);
    font-size: 0.95rem;
}

.reg-form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--brand-primary-20);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reg-form-group input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-20);
}

.reg-form-group input::placeholder {
    color: var(--brand-text-light);
    opacity: 0.7;
}

.btn-register {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--brand-primary-rgb), 0.4);
}

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