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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f0f2f5;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.75rem;
    color: #16213e;
}

.subtitle {
    color: #666;
    margin-top: 0.25rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
}

.queue-badge {
    text-align: right;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab.active {
    color: #16213e;
    border-bottom-color: #0f3460;
    font-weight: 600;
}

.tab:hover {
    color: #16213e;
}

.tab-content {
    margin-bottom: 1rem;
}

.file-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #0f3460;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

textarea:focus, input[type="file"]:focus, select:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 2px rgba(15, 52, 96, 0.15);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #16213e;
}

.btn-primary:active {
    background: #0a2540;
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 0.6rem;
    background: #f0f2f5;
    color: #16213e;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: #e4e7eb;
}

.btn-download {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin: 0.75rem 0;
    transition: background 0.15s;
}

.btn-download:hover {
    background: #16213e;
}

.hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

.status-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

.result-pending, .result-success, .result-error {
    text-align: center;
    padding: 1rem 0;
}

.result-success h2 {
    color: #2d6a4f;
}

.result-error h2 {
    color: #c1121f;
}

.error-detail {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.job-id {
    color: #888;
    font-size: 0.9rem;
    font-family: monospace;
}

.ad-container {
    min-height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

footer {
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* hCaptcha container */
.h-captcha {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}
