:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --success-color: #10B981;
    --success-hover: #059669;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-color: #1F2937;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, #e0e7ff, transparent 40%),
                      radial-gradient(circle at bottom left, #d1fae5, transparent 40%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    text-align: center;
    margin-top: 20px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

header p {
    color: var(--text-light);
    font-size: 15px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.camera-wrapper {
    width: 100%;
    padding: 20px 0;
}

.hint {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-light);
}

#image-preview-container {
    margin-top: 20px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 2px dashed var(--border-color);
}

#image-preview {
    width: 100%;
    height: auto;
    display: block;
}

/* Form Section */
h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

input[type="text"], select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.9);
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn:active {
    transform: scale(0.98);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.success-btn {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.success-btn:hover {
    background-color: var(--success-hover);
}

.outline-btn {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 12px 20px; /* Adjust for border */
}

.outline-btn:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.secondary-btn {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.secondary-btn:hover {
    background-color: #F9FAFB;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

footer {
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Loading Spinner */
#loading-indicator {
    text-align: center;
    padding: 30px;
    color: var(--primary-color);
    font-weight: 500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #374151;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* PDF Preview */
.pdf-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--primary-color);
    background: #EEF2FF;
    border-radius: 12px;
}
.pdf-preview-box span {
    margin-top: 12px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
    word-break: break-all;
}
