@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variables ── */
:root {
    --blue-dark:   #0f2540;
    --blue-mid:    #1a3a5c;
    --blue-light:  #2e6da4;
    --accent:      #4a90d9;
    --accent-glow: rgba(74, 144, 217, 0.25);
    --bg:          #f0f4f8;
    --card-bg:     #ffffff;
    --text:        #1a2a3a;
    --text-muted:  #5a7080;
    --border:      #d0dce8;
    --success-bg:  #d4edda;
    --success-fg:  #155724;
    --error-bg:    #f8d7da;
    --error-fg:    #721c24;
    --radius:      12px;
    --shadow:      0 8px 32px rgba(15, 37, 64, 0.12);
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    overflow-x: hidden;
}

/* ── Background decoration ── */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 260px;
    background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
    z-index: 0;
    border-radius: 0 0 40px 40px;
}

/* ── Card ── */
.upload-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px 32px;
    margin: 24px 16px 32px;
    border: 1px solid rgba(255,255,255,0.8);
}

/* ── Heading ── */
.upload-card h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* ── Form groups ── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: 0.01em;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-group input[type="text"]::placeholder {
    color: #a0b4c4;
    font-size: 0.875rem;
}

/* ── Drop zone ── */
.drop-zone {
    border: 2px dashed var(--accent);
    border-radius: 10px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    color: var(--accent);
    background: #f4f9ff;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.drop-zone:active {
    transform: scale(0.98);
}

.drop-zone.dragover {
    background: #ddeffc;
    border-color: var(--blue-light);
}

.drop-zone strong {
    display: block;
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.drop-zone span {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Preview ── */
#preview-box {
    margin-top: 14px;
    text-align: center;
}

#preview-box img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#preview-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Upload button ── */
.btn-upload {
    width: 100%;
    padding: 14px;
    background: var(--blue-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-upload:hover:not(:disabled) {
    background: var(--blue-light);
    box-shadow: 0 4px 16px rgba(42, 90, 140, 0.35);
}

.btn-upload:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-upload:disabled {
    background: #b0bec8;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Toast ── */
#toast {
    display: none;
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.25s ease;
}

#toast.success {
    background: var(--success-bg);
    color: var(--success-fg);
    border: 1px solid #b8ddc3;
}

#toast.error {
    background: var(--error-bg);
    color: var(--error-fg);
    border: 1px solid #f0b8bc;
}

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

/* ── Mobile full-screen ── */
@media (max-width: 600px) {
    body {
        background: var(--card-bg);
        align-items: stretch;
    }

    body::before {
        height: 200px;
        border-radius: 0 0 28px 28px;
    }

    .upload-card {
        margin: 16px 0 0 0;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 24px rgba(15,37,64,0.10);
        border: none;
        padding: 28px 20px 40px;
        min-height: calc(100dvh - 184px);
        flex: 1;
    }

    .upload-card h2 {
        font-size: 1.15rem;
    }

    .drop-zone {
        padding: 30px 16px;
    }

    .btn-upload {
        padding: 16px;
        font-size: 1.05rem;
    }
}

/* ── Tablet / Desktop ── */
@media (min-width: 601px) {
    body {
        padding: 40px 16px;
    }
}
