/* Request access and signup, in the homepage's brand (homepage.html): limestone ground,
   charcoal type, deep bronze for the main action, bronze for small marks and the focus ring. */

:root {
    color-scheme: light;
    --charcoal: #343630; --ink-2: #4A4942; --ink-3: #67645B;
    --limestone: #FAF8F4; --white: #FFFFFF; --sand-50: #F6F1E9;
    --deep: #795233; --deep-hover: #62421F; --bronze: #A97950;
    --rule: #E6DDD0; --rule-2: #D6C9B6;
    --bad-fg: #8D392C; --bad-bg: #F3E0D9; --ok-fg: #4D5B3D; --ok-bg: #E3E8DA; --warn-fg: #77501A;
    --gut: clamp(16px, 4.4vw, 56px);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --sh-card: 0 1px 2px rgba(40,32,24,.06), 0 12px 28px -12px rgba(40,32,24,.16), 0 30px 60px -34px rgba(40,32,24,.22);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { background: var(--limestone); -webkit-text-size-adjust: 100%; }

body {
    font: 400 15px/1.55 var(--font);
    color: var(--charcoal);
    background: var(--limestone);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--deep); text-decoration-color: var(--bronze); text-underline-offset: 3px; }
a:hover { color: var(--deep-hover); }
:focus-visible { outline: 2.5px solid var(--bronze); outline-offset: 3px; border-radius: 6px; }

/* Header: the full-colour logo, and the way back */

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px var(--gut);
    border-bottom: 1px solid var(--rule);
    background: var(--limestone);
}

.logo { display: block; flex: none; line-height: 0; }
.logo img { display: block; height: 60px; width: auto; }

.back {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
}

.back:hover { color: var(--charcoal); text-decoration: underline; }

.signup-container {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 48px var(--gut) 64px;
}

.signup-card {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--sh-card);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .signup-card { animation: none; }
}

.signup-step-header {
    margin-bottom: 28px;
}

.signup-step-header h2 {
    font-size: 28px;
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.step-desc {
    font-size: 14.5px;
    color: var(--ink-2);
    line-height: 1.55;
}

.domain-display:empty { display: none; }

.domain-display {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--sand-50);
    border-radius: 10px;
    font-weight: 600;
    color: var(--deep);
}

/* Form groups */

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1.5px solid var(--rule-2);
    border-radius: 12px;
    background: var(--white);
    color: var(--charcoal);
    font: 400 15px/1.4 var(--font);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group textarea { resize: vertical; }

.form-group input::placeholder,
.form-group textarea::placeholder { color: #8A867C; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--bronze);
    box-shadow: 0 0 0 3px rgba(169, 121, 80, 0.22);
}

/* a select has no placeholder, so it would show as wrong before anyone touched it */
.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--bad-fg);
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink-3);
}

/* Domain input with @ prefix */

.domain-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--rule-2);
    border-radius: 12px;
    background: var(--white);
    padding: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.domain-input-group:focus-within {
    border-color: var(--bronze);
    box-shadow: 0 0 0 3px rgba(169, 121, 80, 0.22);
}

.domain-prefix {
    padding: 0 4px 0 14px;
    font-weight: 500;
    color: var(--ink-3);
}

.form-group .domain-input-group input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: 12px 14px 12px 0;
    background: transparent;
}

.form-group .domain-input-group input:focus {
    box-shadow: none;
    border: none;
}

/* Buttons */

.btn-primary {
    background: var(--deep);
    color: var(--white);
    border: none;
    border-radius: 999px;
    font: 600 15px/1 var(--font);
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn-secondary {
    background: var(--white);
    color: var(--charcoal);
    border: none;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1.5px var(--rule-2);
    font: 600 15px/1 var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.15s ease;
}

.btn-secondary:hover {
    box-shadow: inset 0 0 0 1.5px var(--ink-3);
}

.btn-large {
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
}

.btn-link {
    background: none;
    color: var(--deep);
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
    text-decoration-color: var(--bronze);
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.btn-link:hover {
    color: var(--deep-hover);
}

form > .btn-link {
    display: block;
    margin: 14px auto 0;
    font-size: 13.5px;
    font-weight: 500;
}

/* Spinner */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */

.signup-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    text-align: center;
    font-size: 13.5px;
    color: var(--ink-3);
}

.signup-footer a {
    font-weight: 500;
}

/* Error messages (inline on request access, a banner on signup) */

.error-message,
.error-banner {
    background: var(--bad-bg);
    color: var(--bad-fg);
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}

.error-banner {
    margin: 16px 0 0;
}

/* Success panels */

.success-message,
.success-box {
    background: var(--ok-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.success-message p {
    margin-bottom: 12px;
    color: var(--ok-fg);
    font-size: 14px;
    line-height: 1.6;
}

.success-message p:last-child {
    margin-bottom: 0;
}

.success-message strong {
    color: var(--ok-fg);
    font-weight: 600;
}

.success-box { margin: 20px 0; text-align: center; color: var(--ok-fg); }
.success-box-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.success-box-body { font-size: 14px; line-height: 1.55; }

.request-id-box {
    background: var(--sand-50);
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.request-id-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }

.request-id-value {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 13px;
    color: var(--charcoal);
    word-break: break-all;
    background: var(--white);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--rule);
}

.next-steps { margin: 24px 0; }
.next-steps p { font-size: 14px; font-weight: 600; color: var(--charcoal); margin-bottom: 8px; }
.next-steps ol { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; margin: 0; padding-left: 20px; }

/* Tips section */

.signup-tips {
    margin-top: 22px;
    padding: 16px;
    background: var(--sand-50);
    border-radius: 12px;
    border: 1px solid var(--rule);
}

.signup-tips p {
    font-size: 13.5px;
    color: var(--charcoal);
    font-weight: 600;
    margin-bottom: 8px;
}

.signup-tips ul {
    list-style: none;
    margin: 0;
}

.signup-tips li {
    font-size: 13.5px;
    color: var(--ink-2);
    margin-bottom: 6px;
    padding-left: 18px;
    position: relative;
}

.signup-tips li:before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bronze);
}

.signup-tips .btn-link {
    font-size: 13.5px;
    padding: 0;
}

/* Responsive */

@media (max-width: 600px) {
    .signup-container {
        padding: 24px var(--gut) 40px;
    }

    .signup-card {
        padding: 26px 20px;
        border-radius: 16px;
    }

    .signup-step-header h2 {
        font-size: 24px;
    }

    .form-group {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .top { padding: 14px var(--gut); }
    .logo img { height: 46px; }
    .back { font-size: 13px; }
}

/* phones (Austin 10/1 mobile overhaul): 16px fields so iPhone does not zoom in on each tap; the small links get room */
@media (max-width: 720px) {
  input:not([type=checkbox]):not([type=radio]), textarea, select { font-size: 16px !important; }
  a.back, .fine a, p a { display: inline-block; padding: 6px 0; }
}
