:root {
    --primary: #F9A825; --primary-dark: #E69100; --primary-text: #9E6200;
    --secondary: #3D3D3D; --bg-white: #ffffff; --bg-light: #f8f9fa;
    --text-dark: #2D2D2D; --text-primary: #3D3D3D; --text-secondary: #6c757d;
    --border: #e9ecef; --error: #dc2626; --success: #16a34a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f2f5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex; flex-direction: column;
}
.top { padding: 1.5rem 2rem; display: flex; justify-content: center; align-items: center; position: relative; }
.top img { height: 48px; width: auto; display: block; }
.lang-switch {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
}
.lang-switch button {
    background: transparent;
    border: 0;
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
    line-height: 0;
    opacity: 0.55;
    filter: saturate(0.7);
    transition: opacity 0.2s ease, filter 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.lang-switch button svg {
    display: block;
    width: 24px;
    height: 16px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.lang-switch button:hover { opacity: 1; filter: none; transform: translateY(-1px); }
.lang-switch button.active { opacity: 1; filter: none; background: #fff; box-shadow: 0 0 0 2px var(--primary); }
.lang-switch button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 520px) {
    .top { flex-direction: column; gap: 0.75rem; }
    .lang-switch { position: static; transform: none; }
}
main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 2.5rem 2.5rem 2rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.08), 0 8px 16px rgba(0,0,0,0.04);
    max-width: 560px;
    width: 100%;
}
h1 { font-size: 1.6rem; color: var(--text-dark); margin-bottom: 0.35rem; text-align: center; }
h1 .tag {
    display: inline-block; background: var(--primary); color: var(--text-dark);
    padding: 0.15rem 0.65rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.05em; vertical-align: middle; margin-left: 0.3rem; text-transform: uppercase;
}
.lead { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; text-align: center; }
.success-icon, .lock-icon { font-size: 2.6rem; text-align: center; margin-bottom: 0.5rem; line-height: 1; }

form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); }
.field label .opt { font-weight: 400; color: var(--text-secondary); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input[type="text"], textarea, select {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-light);
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    outline: none;
}
textarea {
    font-family: 'JetBrainsMono', 'Courier New', monospace;
    font-size: 0.92rem;
    resize: vertical;
    min-height: 140px;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary); background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(249,168,37,0.15);
}
.counter { font-size: 0.75rem; color: var(--text-secondary); text-align: right; }

.submit-btn {
    padding: 0.95rem 1.5rem; background: var(--primary); color: var(--text-dark);
    border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s ease; box-shadow: 0 4px 12px rgba(249,168,37,0.3);
    font-family: inherit; width: 100%; text-align: center; text-decoration: none; display: inline-block;
}
.submit-btn:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(249,168,37,0.4); }
.submit-btn:disabled { opacity: 0.65; cursor: wait; }
.secondary-btn {
    padding: 0.95rem 1.5rem; background: var(--bg-light); color: var(--text-dark);
    border: 2px solid var(--border); border-radius: 10px; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; font-family: inherit; width: 100%;
}
.secondary-btn:hover { border-color: var(--error); color: var(--error); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.25rem; }
.actions .as-link { grid-column: 1 / -1; }

.error {
    padding: 0.75rem 1rem; background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.25);
    border-radius: 8px; color: var(--error); font-size: 0.9rem; margin-bottom: 1rem;
}
.warn {
    padding: 0.75rem 1rem; background: rgba(249,168,37,0.10); border: 1px solid rgba(249,168,37,0.35);
    border-radius: 8px; color: var(--primary-text); font-size: 0.85rem; margin-top: 1rem; line-height: 1.5;
}
.warn:empty { display: none; }
.hint {
    margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
    font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55;
}
.hint code {
    background: var(--bg-light); padding: 0.1rem 0.35rem; border-radius: 4px;
    font-family: 'JetBrainsMono', monospace; font-size: 0.88em; color: var(--primary-text);
}

.link-box { display: flex; gap: 0.5rem; }
.link-box input {
    font-family: 'JetBrainsMono', 'Courier New', monospace; font-size: 0.85rem;
    flex: 1; min-width: 0;
}
.copy-btn {
    padding: 0 1.1rem; background: var(--secondary); color: #fff; border: none; border-radius: 10px;
    font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; transition: background 0.2s;
}
.copy-btn:hover { background: #222; }
.copied { color: var(--success); font-size: 0.85rem; margin-top: 0.5rem; text-align: center; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.25rem; }
.meta { background: var(--bg-light); border-radius: 10px; padding: 0.75rem 1rem; }
.meta-label { display: block; font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.meta-value { display: block; font-weight: 700; color: var(--text-dark); font-size: 0.95rem; }

.secret-box { position: relative; }
.secret-box pre {
    background: #1f2328; color: #e6edf3; border-radius: 12px; padding: 1.25rem 1.25rem 1.25rem;
    font-family: 'JetBrainsMono', 'Courier New', monospace; font-size: 0.92rem; line-height: 1.55;
    white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; min-height: 80px;
}
.copy-btn.inside { position: absolute; top: 0.6rem; right: 0.6rem; padding: 0.35rem 0.8rem; font-size: 0.8rem; background: rgba(255,255,255,0.15); }
.copy-btn.inside:hover { background: rgba(255,255,255,0.3); }

footer { text-align: center; padding: 1.5rem; color: var(--text-secondary); font-size: 0.82rem; }
footer a { color: var(--primary-text); text-decoration: none; }
footer a:hover { color: var(--primary-dark); }

@media (max-width: 520px) {
    .top { padding: 1rem; }
    .card { padding: 1.75rem 1.25rem; }
    h1 { font-size: 1.3rem; }
    .row, .actions, .meta-grid { grid-template-columns: 1fr; }
    .link-box { flex-direction: column; }
    .copy-btn { padding: 0.75rem 1rem; }
}
