/*
 * SurveySphere Solutions: shared tokens and accessible interface primitives.
 * Responsive rules and motion preferences live in ateam-common-responsive.css.
 */

/* ==========================================================================
   Design tokens and interface typography
   ========================================================================== */

:root {
    color-scheme: light;
    --color-navy: #082b56;
    --color-blue: #087ce5;
    --color-blue-dark: #0564c2;
    --color-sky: #17b9f2;
    --color-text: #183451;
    --color-muted: #61758b;
    --color-line: #dce6f0;
    --color-surface: #ffffff;
    --color-background: #f5f9fd;
    --color-error: #ab303e;
    --color-error-background: #fff3f4;
    --radius-field: 10px;
    --font-interface: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

/* ==========================================================================
   Element defaults and base interaction states
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--color-text);
    font-family: var(--font-interface);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

input {
    min-width: 0;
}

a {
    color: var(--color-blue-dark);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* ==========================================================================
   Visibility, keyboard focus and skip navigation
   ========================================================================== */

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid var(--color-blue);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    z-index: 10;
    top: 12px;
    left: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    background: white;
    transform: translateY(-180%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ==========================================================================
   Form labels and optional-field captions
   ========================================================================== */

/* Field labels stay visible; placeholder text is only an example. */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--color-navy);
    font-size: 13px;
    font-weight: 600;
}

.optional-label {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 400;
}

/* ==========================================================================
   Shared input surfaces, leading icons and placeholder text
   ========================================================================== */

.input-shell {
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-field);
    background: #fbfdff;
    transition:
        border-color 0.16s,
        box-shadow 0.16s;
}

.input-shell > i {
    flex: 0 0 44px;
    color: #8297ab;
    font-size: 14px;
    text-align: center;
}

.input-shell input {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px 10px 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: var(--color-navy);
    font-size: 14px;
    outline: 0;
}

.input-shell-plain input {
    padding-left: 14px;
}

.input-shell input::placeholder {
    color: #687e94;
    opacity: 1;
}

/* ==========================================================================
   Input focus and validation states
   ========================================================================== */

.input-shell:focus-within {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgb(8 124 229 / 11%);
}

.input-shell:has([aria-invalid="true"]) {
    border-color: var(--color-error);
}

/* ==========================================================================
   Password visibility controls
   ========================================================================== */

.password-toggle {
    flex: 0 0 43px;
    align-self: stretch;
    border: 0;
    border-radius: 0 var(--radius-field) var(--radius-field) 0;
    background: transparent;
    color: var(--color-muted);
}

.password-toggle:hover {
    color: var(--color-blue);
    background: #eef6ff;
}

/* ==========================================================================
   Field hints, error feedback and paired form rows
   ========================================================================== */

.field-hint,
.field-error {
    margin: 7px 0 0;
    font-size: 11px;
    line-height: 1.6;
}

.field-hint {
    color: var(--color-muted);
}

.field-error {
    color: var(--color-error);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================================================
   Action buttons, variants and inline text actions
   ========================================================================== */

/* Busy feedback belongs to the action, so there is no page-blocking overlay. */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 49px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-field);
    font-size: 14px;
    font-weight: 600;
    transition:
        background 0.16s,
        box-shadow 0.16s,
        transform 0.16s;
}

.button-primary {
    background: linear-gradient(110deg, #0972d6, #048fec);
    color: white;
    box-shadow: 0 6px 16px rgb(8 124 229 / 18%);
}

.button-primary:hover:not(:disabled) {
    background: linear-gradient(110deg, #0564c2, #087ce5);
    box-shadow: 0 8px 22px rgb(8 124 229 / 25%);
    transform: translateY(-1px);
}

.button-secondary {
    border-color: var(--color-line);
    background: #f5f9fd;
    color: var(--color-navy);
}

.button-secondary:hover:not(:disabled) {
    background: #eaf3fc;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-blue-dark);
    font-size: inherit;
    font-weight: 600;
}

.text-button:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Form-level feedback
   ========================================================================== */

.form-message {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid #f0c8cf;
    border-radius: var(--radius-field);
    background: var(--color-error-background);
    color: var(--color-error);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
