:root {
    --primary: #FF9900; /* Amazon Orange */
    --primary-dark: #cc7a00;
    --secondary: #232F3E; /* Amazon Dark Blue */
    --bg-color: #f2f4f8;
    --card-bg: #ffffff;
    --text-main: #0f1111;
    --text-muted: #565959;
    --border-color: #d5d9d9;
    --success: #067d62;
    --error: #cc0c39;
    --border-radius: 8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.lang-toggle-container {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.lang-btn {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.lang-btn:hover {
    background: #e9ecef;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.logo {
    max-width: 180px;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 22px;
    color: var(--secondary);
    margin-bottom: 8px;
    font-weight: 700;
}

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

.step-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Camera Section */
.camera-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.camera-frame {
    position: relative;
    width: 280px;
    height: 380px;
    margin: 0 auto 24px auto;
    border-radius: 50%; /* Makes it an oval */
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15), 0 0 0 4px var(--primary);
}

#camera-video, #camera-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect for front camera */
}

/* Fallback / Upload Box */
.upload-box {
    position: relative;
    border: 2px dashed var(--border-color);
    background: #fafafa;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto 20px;
}

.upload-box.selfie-box {
    border-radius: 50%;
    width: 250px;
    height: 350px;
}

.upload-box.rect-box {
    border-radius: 12px;
    width: 100%;
    max-width: 320px;
    height: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.upload-box input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.upload-content .icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.upload-content .text {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
}

.preview {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 8;
}

/* Loading Overlay inside camera/upload box */
.camera-loader {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(35, 47, 62, 0.85); /* Dark overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    z-index: 20;
    transition: opacity 0.3s;
}

.camera-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Boton Submit */
.btn-submit {
    width: 100%;
    max-width: 300px;
    background: var(--primary);
    color: #111;
    border: none;
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto 0 auto; /* Center horizontally */
    box-shadow: 0 4px 10px rgba(255, 153, 0, 0.3);
}

.btn-submit:active {
    transform: scale(0.97);
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #666;
    box-shadow: none;
    transform: none;
}

.secure-notice {
    text-align: center;
    font-size: 12px;
    color: var(--success);
    margin-top: 16px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-logo {
    max-width: 150px;
    margin-bottom: 24px;
}

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

.success-icon {
    width: 70px;
    height: 70px;
    background: var(--success);
    color: white;
    font-size: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-content h3 {
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 20px;
}

.modal-content p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Animations */
@keyframes flip {
    0% { transform: perspective(400px) rotateY(0deg); }
    100% { transform: perspective(400px) rotateY(180deg); }
}

/* Input Styles for OTP */
.form-group {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.2);
}
.section-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 320px;
}
