@import url('theme.css');
@import url('onboarding.css');
* { box-sizing: border-box; }
html { min-width: 280px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 5px; }
.connection-page { max-width: 1440px; min-height: 100svh; margin: auto; padding: 0 6.2%; display: flex; flex-direction: column; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 36px 0 26px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 218px; height: auto; object-fit: contain; display: block; }
.header-label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.connection-layout { display: grid; grid-template-columns: 1fr minmax(360px, 450px); align-items: center; gap: 8%; flex: 1; padding: 65px 0 72px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2.2px; color: var(--brand); }
h1 { font-size: clamp(38px, 3.9vw, 58px); font-weight: 650; line-height: 1.12; letter-spacing: -2px; margin: 22px 0; }
h1 span { color: var(--brand); }
.intro-copy { color: var(--muted); font-size: 16px; line-height: 1.8; margin-bottom: 35px; }
.welcome-message { max-width: 400px; margin-top: 28px; }
.welcome-heading { color: var(--brand); font-size: 22px; font-weight: 600; line-height: 1.4; letter-spacing: -.3px; margin: 0 0 10px; }
.welcome-copy { color: var(--muted); font-size: 16px; line-height: 1.8; margin: 0; }
.connection-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.connection-steps li { display: flex; align-items: flex-start; gap: 17px; }
.step-number { border: 1px solid var(--line); background: var(--surface); color: var(--brand); border-radius: 10px; font-size: 11px; font-weight: 700; display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; }
.connection-steps strong { font-size: 14px; font-weight: 600; }
.connection-steps p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 4px 0 0; }
.intro-footnote { display: flex; align-items: center; gap: 12px; margin-top: 42px; color: var(--muted); font-size: 12px; }
.small-rule { height: 1px; width: 28px; background: var(--brand); }
.connection-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 65px var(--shadow); padding: 30px 34px 0; overflow: hidden; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 9px; letter-spacing: 1.5px; font-weight: 700; color: var(--muted); }
.step-pill { background: var(--accent); border-radius: 5px; color: var(--brand); padding: 6px 8px; letter-spacing: 1px; }
.connection-symbol { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 15px; background: var(--accent); color: var(--brand); margin-top: 30px; }
h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.7px; font-weight: 650; margin: 22px 0 10px; }
.card-description { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0 0 30px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
input { display: block; width: 100%; min-width: 0; padding: 14px 15px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 16px; min-height: 50px; }
input::placeholder { color: var(--placeholder); font-size: 14px; }
input:focus, input[aria-invalid="true"] { border-color: var(--brand); }
.field-hint { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 9px 0 23px; }
.primary-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; padding: 14px 18px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.primary-button > span:last-child:not(:first-child) { margin-left: auto; }
.primary-button:has(.spinner) { justify-content: center; }
.primary-button:has(.spinner) > span { margin-left: 0; }
.primary-button:hover { background: var(--brand-hover); }
.primary-button:disabled { cursor: wait; opacity: .75; }
input:disabled { background: var(--canvas); }
.privacy-note { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 22px 0 28px; color: var(--muted); }
.privacy-note p { margin: 0; font-size: 11px; line-height: 1.7; }
.privacy-note svg { flex-shrink: 0; }
.card-footer { margin: 0 -34px; padding: 19px 20px; text-align: center; background: var(--subtle); border-top: 1px solid var(--line); font-size: 11px; line-height: 1.8; color: var(--muted); }
.card-footer a { font-weight: 600; display: inline-block; padding: 5px 2px; }
.page-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; padding: 23px 0 28px; color: var(--muted); font-size: 11px; }
.feedback-error { margin: 0 0 20px; padding: 13px 15px; border-left: 3px solid var(--brand); background: var(--accent); border-radius: 4px; color: var(--brand); font-size: 12px; line-height: 1.6; }
.feedback-error p { margin: 4px 0 0; }
.success-symbol { font-size: 30px; }
.selected-database { background: var(--subtle); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; gap: 10px; margin-bottom: 20px; }
.selected-database > span:first-child { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.selected-database strong { font-size: 18px; overflow-wrap: anywhere; }
.confirmed-label { display: flex; align-items: center; gap: 8px; color: var(--brand); font-size: 11px; }
.next-step-note { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0 0 24px; }
.selected-database ~ .primary-button { margin-bottom: 30px; }
.spinner { width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; background: var(--surface); padding: 12px; z-index: 100; }
.skip-link:focus { top: 12px; }
.utility-page { max-width: 600px; margin: 12vh auto; padding: 24px; }
@media (max-width: 950px) {
    .connection-page { padding: 0 5%; }
    .connection-layout { gap: 5%; grid-template-columns: 1fr minmax(330px, 400px); }
    .connection-card { padding: 26px 25px 0; }
    .card-footer { margin-left: -25px; margin-right: -25px; }
    h1 { font-size: 42px; }
    .desktop-break { display: none; }
}
@media (max-width: 720px) {
    .connection-page { padding: 0 22px; }
    .page-header { padding: 25px 0 20px; }
    .brand-logo { width: 174px; }
    .header-label { font-size: 11px; gap: 6px; }
    .connection-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 35px 0 40px; max-width: 460px; width: 100%; margin: auto; }
    .introduction { text-align: center; }
    .eyebrow { font-size: 9px; letter-spacing: 1.7px; }
    h1 { font-size: 39px; letter-spacing: -1.4px; margin: 15px 0 12px; }
    h1 br { display: none; }
    h1 span { display: block; }
    .intro-copy { font-size: 13px; margin: 0; line-height: 1.7; }
    .welcome-message { margin: 22px auto 0; }
    .welcome-heading { font-size: 20px; margin-bottom: 8px; }
    .welcome-copy { font-size: 14px; line-height: 1.7; }
    .connection-steps, .intro-footnote { display: none; }
    .connection-card { border-radius: 16px; }
    .connection-symbol { margin-top: 24px; width: 48px; height: 48px; }
    h2 { font-size: 24px; }
    .card-description { font-size: 13px; margin-bottom: 25px; }
    .page-footer { flex-direction: column; gap: 8px; text-align: center; font-size: 10px; }
}
@media (max-width: 359px) { .connection-page { padding: 0 14px; } .brand-logo { width: 145px; } .connection-card { padding: 22px 20px 0; } .card-footer { margin: 0 -20px; } h2 { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* Company sign-in shares the Cloud Connect theme. */
.primary-button { text-decoration: none; }
.secondary-button { display: block; width: 100%; min-height: 46px; margin: 12px 0 24px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.secondary-button:hover { background: var(--accent); }

.login-card h2 { margin-top: 28px; }
.login-card .card-description { margin-bottom: 22px; }
.login-layout { padding-top: 45px; padding-bottom: 50px; }
.company-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--subtle); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 24px; }
.company-strip > div { min-width: 0; }
.company-strip span { display: block; color: var(--muted); font-size: 9px; letter-spacing: 1px; font-weight: 700; margin-bottom: 6px; }
.company-strip strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.text-button { border: 0; background: transparent; color: var(--brand); font-weight: 600; font-size: 12px; cursor: pointer; min-height: 44px; padding: 6px; text-decoration: underline; text-underline-offset: 4px; flex-shrink: 0; }
.text-button:disabled { cursor: wait; opacity: .65; }
.login-field { margin-bottom: 18px; }
.login-methods { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 4px; padding: 4px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--accent); }
.login-methods button { min-height: 44px; padding: 9px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.login-methods button[aria-pressed="true"] { background: var(--brand); color: white; font-weight: 600; }
.login-methods button:disabled { opacity: .65; cursor: wait; }
#login-pin { letter-spacing: .15em; }
#login-pin::placeholder { letter-spacing: normal; }
.login-field .field-hint { margin-bottom: 0; }
select { font: inherit; width: 100%; min-width: 0; min-height: 50px; padding: 13px 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--input-border); border-radius: 8px; font-size: 14px; }
select:disabled { background: var(--canvas); color: var(--muted); opacity: 1; }
.login-privacy { margin: 21px 0 24px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.7; }
.connection-required { font-size: 12px; line-height: 1.65; background: var(--accent); border-radius: 6px; padding: 12px; color: var(--brand); margin: -10px 0 22px; }
.verified-account { display: flex; align-items: center; gap: 10px; background: var(--accent); border-radius: 9px; padding: 12px 14px; margin-bottom: 24px; }
.verified-account > div { min-width: 0; flex: 1; }
.verified-account strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.verified-account div span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.verified-check { color: var(--brand); font-size: 20px; }
.login-summary { border: 1px solid var(--line); background: var(--subtle); padding: 8px 18px; border-radius: 10px; margin: 24px 0; }
.login-summary > div { padding: 12px 0; }
.login-summary dt { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.login-summary dd { font-size: 15px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
    .login-layout { padding-top: 30px; gap: 24px; }
    .login-layout .introduction h1 { font-size: 34px; }
    .login-layout .intro-copy { max-width: 340px; margin: auto; }
    .login-card h2 { font-size: 23px; }
}

.connection-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; margin: 0 0 26px; padding: 18px; background: var(--subtle); border: 1px solid var(--line); border-radius: 10px; }
.connection-details dt { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.connection-details dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

.directory-details { grid-template-columns: minmax(0, 1fr); }
.connection-card .selected-database ~ .primary-button { margin-bottom: 0; }
.temporary-sql-notice { padding: 13px 15px; border-left: 3px solid var(--brand); background: var(--accent); color: var(--muted); font-size: 11px; line-height: 1.7; border-radius: 4px; margin: 0 0 22px; }
.temporary-sql-notice strong, .temporary-sql-notice span { display: block; }
.temporary-sql-notice strong { color: var(--brand); margin-bottom: 4px; }

/* Phones show the company/sign-in form directly; tablet and desktop keep their cards. */
@media (max-width: 600px) {
    .connection-page { background: var(--surface); }
    .page-header { border-bottom: 0; padding-bottom: 12px; }
    .connection-layout,
    .connection-layout.login-layout { align-items: start; gap: 0; padding: 24px 0 32px; margin: 0 auto; }
    .connection-layout .introduction { display: none; }
    .connection-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
    .card-footer { margin: 0; padding: 20px 0 0; border-top: 0; background: transparent; }
    .page-footer { border-top: 0; padding: 16px 0 20px; }
}
