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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.screen {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

/* Welcome Screen */
.info-message {
    text-align: center;
    padding: 40px 20px;
}

.info-message h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #4a90e2;
}

.info-message p {
    color: #666;
}

/* Form Screen */
.header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.header h2 {
    font-size: 22px;
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90e2;
}

.form-group input[readonly] {
    background-color: #f9f9f9;
    color: #666;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background-color: #fff;
    cursor: pointer;
}

/* Form row for side-by-side fields */
.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    flex: 1;
    min-width: 0;
}

/* Required field indicator */
.required {
    color: #c33;
    font-weight: bold;
}

/* Field hint text */
.field-hint {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

/* Input group (for phone prefix) */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-prepend {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background-color: #e9ecef;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}

.input-group input {
    flex: 1;
    border-radius: 0 4px 4px 0 !important;
    min-width: 0;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 16px;
    padding-top: 4px;
}

.radio-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 400 !important;
    color: #333 !important;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* File upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.file-upload-label {
    display: block !important;
    padding: 10px 12px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    font-weight: 400 !important;
    color: #888 !important;
}

.file-upload-label:hover {
    border-color: #4a90e2;
    background-color: #f8faff;
}

.file-upload-text {
    font-size: 13px;
}

.file-name-display {
    font-size: 12px;
    color: #4a90e2;
    margin-top: 4px;
    font-weight: 600;
}

/* Scrollable form for many fields */
#form-screen {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Buttons */
.form-actions {
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #4a90e2;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Status Messages */
.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.status-message.error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.status-message.success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.status-message.info {
    background-color: #eef;
    color: #33c;
    border: 1px solid #ccf;
}

/* Success Screen */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background-color: #4caf50;
    color: #fff;
    font-size: 36px;
    line-height: 60px;
    border-radius: 50%;
}

.success-message h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.success-message p {
    color: #666;
    margin-bottom: 24px;
}

#new-submission-btn {
    display: inline-block;
    min-width: 200px;
    width: auto;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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