:root {
    --bg: #0a8f58;
    --bg-soft: #13a468;
    --card: rgba(255, 255, 255, 0.98);
    --text: #1f2937;
    --muted: #6b7280;
    --line: #d1d5db;
    --primary: #0a8f58;
    --primary-dark: #086f45;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg), var(--bg-soft));
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card {
    width: 100%;
    max-width: 480px;
    background: var(--card);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 24px;
    backdrop-filter: blur(6px);
}

.logo-container,
.header-block { text-align: center; }
.logo-container { margin-bottom: 12px; }
.brand-logo { width: min(100%, 96px); height: auto; display: inline-block; }
.header-block { margin-bottom: 22px; }

h1 {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.1;
}

.subtitle {
    margin: 0 auto 14px;
    max-width: 340px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 15px;
}

.device-badge {
    display: inline-block;
    margin: 0;
    padding: 8px 14px;
    background: #eefaf4;
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.form-group { margin-bottom: 18px; }
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 16px;
    background: #fff;
}

input[type="file"] { display: none; }

.file-trigger {
    width: 100%;
    display: block;
    margin-bottom: 10px;
    padding: 14px 16px;
    border: 1px solid #b7dfcb;
    border-radius: 14px;
    background: #f4fbf7;
    color: var(--primary-dark);
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.file-trigger:hover { background: #ebf7f0; }
.file-name {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    word-break: break-word;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 143, 88, 0.12);
}

.helper-text {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.preview-card {
    min-height: 200px;
    border: 2px dashed #cfe6da;
    border-radius: 18px;
    background: #f8fcfa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    text-align: center;
    margin-bottom: 18px;
    overflow: hidden;
}

#previewPlaceholder { margin: 0; color: var(--muted); line-height: 1.5; }
#photoPreview {
    max-width: 100%;
    max-height: 320px;
    border-radius: 14px;
    object-fit: contain;
}

button {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    transition: transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.message {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
}
.message.success { background: #e8f8ee; color: #166534; border: 1px solid #b9e6c8; }
.message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.message.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

@media (max-width: 600px) {
    .page-shell {
        padding: 12px;
        align-items: stretch;
    }

    .card {
        max-width: 100%;
        min-height: calc(100vh - 24px);
        border-radius: 18px;
        padding: 20px 16px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .brand-logo { width: 78px; }
    h1 { font-size: 24px; }
    .subtitle { font-size: 14px; }
    .file-trigger, button { font-size: 16px; padding: 15px 14px; }
    .preview-card { min-height: 180px; }
    #photoPreview { max-height: 240px; }
}
