/* Authentication Widget Styles (extracted from nature-vibes.css) */
:root {
    --primary: #8A2BE2;
    --secondary: #FF69B4;
    --dark-blue: #191970;
    --light: #F8F9FA;
    --dark: #212529;
    --accent: #E6E6FA;
    --success: #28a745;
    --danger: #dc3545;
}
body {
    background-color: var(--light);
    color: var(--dark);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    min-width: 0;
}
.container {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 0 18px;
}
.authentication {
    padding: 40px 0;
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary) 100%);
    color: white;
    text-align: center;
}
.authentication h2 {
    font-size: 28px;
    margin-bottom: 16px;
}
.authentication p {
    max-width: 400px;
    margin: 0 auto 20px;
    font-size: 16px;
}
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background-color: white;
    padding: 20px 18px;
    border-radius: 10px;
    color: var(--dark);
    box-sizing: border-box;
}
.verification-step {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    background-color: #f8f9fa;
    display: none;
}
.verification-step.active {
    display: block;
    border-left: 4px solid var(--primary);
}
.verification-step h3 {
    color: var(--dark-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
#reference-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.camera-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    max-height: 70vh;
}
.camera-container video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
}
.camera-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.camera-button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}
.camera-button:hover {
    background-color: var(--dark-blue);
}
.retake-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.retake-button:hover {
    background-color: #5a6268;
}
.submit-button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}
.submit-button:hover:not(:disabled) {
    background-color: var(--dark-blue);
}
.submit-button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}
.verification-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}
.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #aaa;
}
.progress-step.completed {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}
.progress-line {
    width: 40px;
    height: 2px;
    background-color: #ddd;
}
.progress-line.completed {
    background-color: var(--primary);
}
.manual-input-section {
    margin-top: 10px;
    width: 100%;
    text-align: center;
}
#manual-input-form {
    margin-top: 10px;
    transition: all 0.3s ease;
}
#manual-input-form.hidden {
    display: none;
}
#barcode-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 15px;
}
.upload-section {
    margin-top: 10px;
}
#scan-region {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}
.corner-tl, .corner-tr, .corner-bl, .corner-br {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--primary);
    border-width: 3px;
}
.corner-tl {
    top: -3px;
    left: -3px;
    border-top-style: solid;
    border-left-style: solid;
    border-top-left-radius: 5px;
}
.corner-tr {
    top: -3px;
    right: -3px;
    border-top-style: solid;
    border-right-style: solid;
    border-top-right-radius: 5px;
}
.corner-bl {
    bottom: -3px;
    left: -3px;
    border-bottom-style: solid;
    border-left-style: solid;
    border-bottom-left-radius: 5px;
}
.corner-br {
    bottom: -3px;
    right: -3px;
    border-bottom-style: solid;
    border-right-style: solid;
    border-bottom-right-radius: 5px;
}
.scanner-instructions {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 5px;
    margin: 0 auto;
    width: 80%;
    max-width: 220px;
    font-size: 13px;
}
.camera-instructions {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    font-size: 12px;
    margin: 0 auto;
    width: 80%;
    max-width: 220px;
    border-radius: 10px;
}
#reference-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}
#overlay-image {
    max-width: 150%;
    max-height: 150%;
    opacity: 0.3;
}
.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(138, 43, 226, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#result-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.success-icon {
    color: var(--success);
}
.error-icon {
    color: var(--danger);
}
.warning-icon {
    color: #ffc107;
}
.error-title {
    color: var(--danger);
}
#result-content {
    text-align: center;
    margin-bottom: 20px;
}
#result-reference {
    margin-top: 12px;
    padding: 10px;
    background-color: var(--accent);
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
}
.hidden {
    display: none !important;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    max-width: 350px;
    text-align: center;
}
.close-button {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
.close-button:hover {
    color: black;
}
.modal-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.success-icon {
    color: #28a745;
}
.failure-icon {
    color: #dc3545;
}
.zoom-controls {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 6px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.zoom-button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    padding: 5px;
    margin: 3px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zoom-button:hover {
    transform: scale(1.1);
}
#zoom-level {
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin: 5px 0;
    text-align: center;
}
#captured-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#captured-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
@media (max-width: 600px) {
    .container, .auth-form {
        max-width: 100vw;
        padding: 8px 6px;
    }
    .authentication {
        padding: 10px 0;
    }
    .camera-container {
        min-height: 180px;
    }
}

/* Ensure all elements use border-box */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    overflow-x: hidden;
} 