/* =====================================================================
   Companion platform — extends the IoA design system (style.css tokens)
   and reuses catalog.css's card/panel language (.detail-panel,
   .panel-header, .detail-row) so the account/dashboard pages read as
   part of the same system as the item catalog.
   ===================================================================== */

/* --- Auth pages (login / signup) --- */
.auth-shell {
    max-width: 440px;
    margin: 0 auto;
}

.form-field {
    margin-bottom: 18px;
}
.form-field label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ioa-text-muted);
    margin-bottom: 6px;
}
.form-field input {
    width: 100%;
    height: 45px;
    background: #0a0d12;
    border: 1px solid var(--catalog-border);
    color: var(--ioa-text);
    padding: 0 14px;
    font-family: 'Quattrocento', Georgia, serif;
    border-radius: 2px;
}
.form-field input:focus {
    outline: none;
    border-color: var(--ioa-gold);
}

/* Browsers force their own light background on autofilled inputs
   (Chrome/Safari's internal -webkit-autofill styling), which can't be
   overridden with a normal background rule - this is the standard
   workaround: an inset box-shadow the same color as the field paints
   over the browser's own fill color, and a long transition delay stops
   it flashing in before the override applies. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #0a0d12 inset !important;
    -webkit-text-fill-color: var(--ioa-text) !important;
    caret-color: var(--ioa-text);
    transition: background-color 9999s ease-in-out 0s;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--ioa-text-muted);
    margin-top: 6px;
}

.form-submit.button {
    width: 100%;
    margin: 8px 0 0 0;
}

.form-message {
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    display: none;
}
.form-message.is-error {
    display: block;
    border: 1px solid #d9736a;
    color: #f0a89f;
    background: rgba(217, 115, 106, 0.08);
}
.form-message.is-success {
    display: block;
    border: 1px solid #6fbf73;
    color: #9fdba2;
    background: rgba(111, 191, 115, 0.08);
}

.auth-switch {
    text-align: center;
    margin-top: 22px;
    color: var(--ioa-text-muted);
    font-size: 0.9rem;
}

/* --- Dashboard --- */
.companion-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 30px;
}
.companion-header-row h1 { margin-bottom: 6px; }

.companion-columns {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 26px;
    align-items: start;
}

#account-panel {
    margin-bottom: 26px;
}

.account-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(138, 147, 163, 0.15);
}
.account-field:last-child { border-bottom: none; }
.account-field .field-label { color: var(--ioa-text-muted); }
.account-field .field-value { color: var(--ioa-text); font-weight: bold; }

.field-value-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.edit-link-btn {
    background: none;
    border: none;
    color: var(--ioa-gold);
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
}
.edit-link-btn:hover { color: var(--ioa-gold-bright); }
.edit-link-btn i { margin-right: 4px; }

.inline-edit-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    flex-wrap: wrap;
}
.inline-edit-form input {
    flex: 1 1 160px;
    height: 38px;
    background: #0a0d12;
    border: 1px solid var(--catalog-border);
    color: var(--ioa-text);
    padding: 0 12px;
    font-family: 'Quattrocento', Georgia, serif;
    border-radius: 2px;
}
.inline-edit-form input:focus { outline: none; border-color: var(--ioa-gold); }
.inline-edit-form .button {
    width: auto;
    height: 38px;
    margin: 0;
    padding: 0 16px;
}

.character-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(138, 147, 163, 0.12);
}
.character-row:last-child { border-bottom: none; }
.character-row .row-icon { color: var(--ioa-gold); }
.character-name { color: var(--ioa-text); font-weight: bold; }
.character-meta { color: var(--ioa-text-muted); font-size: 0.8rem; margin-top: 3px; }
.character-guid {
    font-size: 0.72rem;
    color: var(--ioa-text-muted);
    word-break: break-all;
}

.link-character-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.link-character-form input {
    flex: 1 1 200px;
    height: 45px;
    background: #0a0d12;
    border: 1px solid var(--catalog-border);
    color: var(--ioa-text);
    padding: 0 14px;
    font-family: 'Quattrocento', Georgia, serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 2px;
}
.link-character-form input:focus {
    outline: none;
    border-color: var(--ioa-gold);
}
.link-character-form .button {
    width: auto;
    margin: 0;
    height: 45px;
    white-space: nowrap;
}

.logout-btn {
    width: auto;
    margin: 0;
    padding: 8px 20px;
}

@media (max-width: 900px) {
    .companion-columns { grid-template-columns: 1fr; }
}
