:root {
    /* macOS 15.7.4 Style Variables */
    --bg-color: #F5F5F7; 
    --card-bg: rgba(255, 255, 255, 0.75);
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --accent-color: #007AFF; /* Apple Blue */
    --accent-hover: #0070EB;
    
    /* 0.5px border sim */
    --border-color: rgba(0, 0, 0, 0.08); 
    --border-hl: rgba(0, 122, 255, 0.5);
    
    /* macOS Ambient + Drop Shadows */
    --shadow-card: 0 4px 24px -8px rgba(0, 0, 0, 0.08), 0 2px 8px -2px rgba(0,0,0,0.04);
    --shadow-hover: 0 16px 32px -8px rgba(0, 0, 0, 0.1), 0 4px 16px -4px rgba(0,0,0,0.05);
    --shadow-inner: inset 0 1px 2px rgba(255, 255, 255, 0.9);
    
    /* Spring animations */
    --spring-duration: 0.4s;
    --spring-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 50px 20px;
    background-image: radial-gradient(circle at top left, rgba(255,255,255,0.8), transparent 400px);
}

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

header h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

header .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 0.5px solid var(--border-color);
    border-radius: 20px;
    padding: 36px;
    box-shadow: var(--shadow-card), var(--shadow-inner);
    transition: box-shadow var(--spring-duration) var(--spring-ease), transform var(--spring-duration) var(--spring-ease);
}

.card:hover {
    box-shadow: var(--shadow-hover), var(--shadow-inner);
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.required {
    color: #FF3B30; /* Apple Red */
}

input, select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.9);
    border: 0.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text-primary);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.25s var(--spring-ease);
    font-family: inherit;
    width: 100%;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "chevron_down";
    font-family: -apple-system; /* fallback to standard caret if needed */
    content: "⌄";
    font-size: 18px;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-60%);
    color: var(--text-secondary);
    pointer-events: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2), inset 0 1px 2px rgba(0,0,0,0.02);
}

.preview-box {
    margin-top: 28px;
    padding: 16px 20px;
    background: rgba(0, 122, 255, 0.06);
    border-radius: 12px;
    border: 0.5px solid rgba(0, 122, 255, 0.15);
    font-size: 14px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-all;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}

.preview-box strong {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.2px;
}

/* Upload Section */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.dropzone {
    background: rgba(255, 255, 255, 0.4);
    border: 1.5px dashed var(--border-color);
    border-radius: 16px;
    height: 140px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--spring-bounce);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dropzone:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--text-secondary);
}

.dropzone:active {
    transform: scale(0.95);
}

/* Drag over active state */
.dropzone.dragover {
    background: rgba(0, 122, 255, 0.08);
    border-color: var(--accent-color);
    border-style: solid;
    transform: scale(1.03);
}

/* Uploaded state */
.dropzone.has-file {
    background: rgba(255, 255, 255, 1);
    border-color: #34C759; /* Apple Green */
    border-style: solid;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.15);
}

.dz-icon {
    font-size: 32px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.dz-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.dz-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 6px;
    animation: springFadeIn 0.5s var(--spring-bounce);
}

@keyframes springFadeIn { 
    from {opacity: 0; transform: translateY(10px) scale(0.95);} 
    to {opacity: 1; transform: translateY(0) scale(1);}
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 10px;
}

.file-size {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-remove {
    margin-top: 4px;
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
    border: none;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
}

.btn-remove:hover { 
    background: #FF3B30;
    color: white;
}
.btn-remove:active { transform: scale(0.92); }

/* Primary Action Section */
.action-section {
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.3);
    transition: all 0.3s var(--spring-bounce);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.9;
}

/* Loader */
.loader-hidden { display: none !important; }
.btn-loader {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* macOS Style Toast */
.toast {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s var(--spring-bounce);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.15);
    border: 0.5px solid rgba(255,255,255,0.1);
}

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