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

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--grey-900);
}

a { color: var(--grey-900); }

h1:focus { outline: none; }

.card {
    width: 100%;
    max-width: 680px;
    background: #ffffff;
    border: 1px solid var(--grey-100);
    border-radius: 6px;
    padding: 2.5rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .05);
}

h1 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    line-height: 1.15;
    margin: 0 0 .8rem;
    font-weight: 800;
}

h1 .accent { box-shadow: inset 0 -10px 0 var(--accent-soft); }

.lead {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 2rem;
}

.eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--on-accent);
    background: var(--accent);
    padding: .35rem .8rem;
    border-radius: 3px;
    margin-bottom: 1.2rem;
}

.field { margin-bottom: 1.4rem; }

label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
}

.optional, .hint {
    color: var(--text-muted);
    font-weight: 400;
}

.hint {
    display: block;
    font-size: .82rem;
    margin-top: .35rem;
    word-break: break-all;
}

input {
    width: 100%;
    font: inherit;
    padding: .75rem .9rem;
    border: 1px solid var(--grey-400);
    border-radius: 4px;
    background: #ffffff;
    color: var(--grey-900);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.alias-input {
    display: flex;
    align-items: stretch;
}

.alias-input .prefix {
    display: flex;
    align-items: center;
    padding: 0 .75rem;
    background: var(--grey-100);
    border: 1px solid var(--grey-400);
    border-right: none;
    border-radius: 4px 0 0 4px;
    color: var(--text-muted);
    font-size: .9rem;
    white-space: nowrap;
}

.alias-input input { border-radius: 0 4px 4px 0; }

input.invalid { border-color: #c0392b; }

.validation-message {
    color: #c0392b;
    font-size: .85rem;
    margin-top: .35rem;
}

.alert-error {
    background: #fdecea;
    color: #8e2b20;
    border-left: 4px solid #c0392b;
    padding: .75rem 1rem;
    margin-bottom: 1.2rem;
    border-radius: 3px;
}

.btn {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: .8rem 1.6rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    background: var(--accent);
    color: var(--on-accent);
}

.btn:hover { background: var(--accent-hover); }

.btn-secondary {
    background: var(--grey-900);
    color: #ffffff;
    padding: .6rem 1.2rem;
}

.btn-secondary:hover { background: var(--grey-700); }

.result {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--grey-100);
}

.result-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .8rem 1rem;
    background: var(--grey-100);
    border-radius: 4px;
}

.result-row a {
    flex: 1;
    font-weight: 700;
    font-size: 1.1rem;
    word-break: break-all;
}

@media (max-width: 560px) {
    .card { padding: 1.5rem; }
    .alias-input { flex-direction: column; }
    .alias-input .prefix { border-right: 1px solid var(--grey-400); border-bottom: none; border-radius: 4px 4px 0 0; padding: .5rem .75rem; }
    .alias-input input { border-radius: 0 0 4px 4px; }
}

.tabs {
    display: flex;
    gap: .5rem;
    margin: -.5rem 0 2rem;
    border-bottom: 1px solid var(--grey-100);
}

.tab {
    padding: .6rem 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.tab:hover { color: var(--grey-900); }

.tab.active {
    color: var(--grey-900);
    border-bottom-color: var(--accent);
}

.field.checkbox {
    display: flex;
    align-items: baseline;
    gap: .6rem;
}

.field.checkbox input { width: auto; }
.field.checkbox label { margin: 0; }

.qr-image {
    width: 220px;
    padding: .5rem;
    background: #ffffff;
    border: 1px solid var(--grey-100);
    border-radius: 4px;
}

.qr-image svg { display: block; width: 100%; height: auto; }

.qr-actions {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
