* {
    box-sizing: border-box;
}

:root {
    --page-max-width: 980px;
    --card-radius: clamp(16px, 2vw, 24px);
    --field-radius: clamp(10px, 1.4vw, 12px);
    --space-xs: clamp(8px, 1vw, 12px);
    --space-sm: clamp(12px, 1.5vw, 16px);
    --space-md: clamp(16px, 2vw, 24px);
    --space-lg: clamp(20px, 3vw, 32px);
    --space-xl: clamp(24px, 4vw, 40px);
    --text-sm: clamp(0.92rem, 1.3vw, 0.98rem);
    --text-md: clamp(0.98rem, 1.5vw, 1.05rem);
    --text-lg: clamp(1.65rem, 3vw, 2.2rem);
}

body {
    margin: 0;
    min-height: 100vh;
    padding: clamp(12px, 2vw, 24px);
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 45%, #f8fafc 100%);
    color: #1f2937;
}

.page-shell {
    position: relative;
    width: min(100%, calc(var(--page-max-width) + clamp(180px, 20vw, 250px)));
    margin: 0 auto;
    padding-top: clamp(12px, 2vw, 24px);
}

.top-logo {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
}

.top-logo a {
    display: block;
}

.top-logo img {
    width: clamp(120px, 18vw, 220px);
    max-width: 38vw;
    height: auto;
    display: block;
}

.page-wrapper {
    width: min(100%, var(--page-max-width));
    margin: clamp(56px, 8vw, 84px) auto clamp(8px, 2vw, 32px);
    padding: clamp(20px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--card-radius);
    box-shadow: 0 20px 50px rgba(30, 41, 59, 0.18);
    backdrop-filter: blur(8px);
}

.hero-header {
    margin-bottom: clamp(20px, 3vw, 28px);
}

.hero-text {
    min-width: 0;
}

h1 {
    margin: 0 0 clamp(8px, 1.5vw, 12px);
    font-size: var(--text-lg);
    line-height: 1.15;
    color: #0f172a;
}

h2 {
    margin: 0;
    font-size: var(--text-md);
    font-weight: normal;
    line-height: 1.5;
    color: #475569;
}

h2 a {
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
}

h2 a:hover {
    text-decoration: underline;
}

.error-message {
    color: #dc2626;
    font-weight: bold;
    font-size: var(--text-sm);
}

.error-message:not(:empty) {
    margin: 0 0 var(--space-md);
    min-height: 24px;
}

.error-message:empty {
    margin: 0;
    min-height: 0;
    height: 0;
}

form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

[data-cols="3"] {
    --cols: minmax(180px, 1.2fr) minmax(240px, 1.3fr) minmax(220px, 1.7fr);
}

[data-cols="2"] {
    --cols: minmax(180px, 1.2fr) minmax(240px, 1.3fr);
}

.form-grid {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: clamp(14px, 2vw, 18px);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.form-row {
    display: grid;
    gap: 0;
    background: #dbe3ee;
    border-bottom: 1px solid #e5e7eb;
    align-items: stretch;
    grid-template-columns: var(--cols);
}

.form-cell {
    background: #ffffff;
    padding: clamp(12px, 2vw, 16px);
    min-width: 0;
    display: flex;
    align-items: center;
    align-self: stretch;
}
.form-help {
    align-items: flex-start;
}

.form-help .password-help-box {
    width: 100%;
}

.form-row:last-child {
    border-bottom: none;
}

.form-label {
    font-weight: bold;
    color: #1e293b;
    line-height: 1.45;
    font-size: var(--text-sm);
    display: block;
}

.form-input input[type="text"],
.form-input input[type="password"],
.form-input input[type="email"] {
    width: 100%;
    min-width: 0;
    padding: clamp(10px, 1.6vw, 12px) clamp(12px, 1.8vw, 14px);
    border: 1px solid #cbd5e1;
    border-radius: var(--field-radius);
    background: #f8fafc;
    font-size: var(--text-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input input[type="text"]:focus,
.form-input input[type="password"]:focus,
.form-input input[type="email"]:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: #ffffff;
}

.form-input textarea {
    width: 100%;
    min-width: 0;
    min-height: 8rem;       /* ~5–6 lines depending on font */
    padding: clamp(10px, 1.6vw, 12px) clamp(12px, 1.8vw, 14px);
    border: 1px solid #cbd5e1;
    border-radius: var(--field-radius);
    background: #f8fafc;
    font-size: var(--text-sm);
    font-family: inherit;
    line-height: 1.4;
    resize: vertical;       /* user can make it taller */
}

.form-input textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: #ffffff;
}

.field-note {
    color: #475569;
    line-height: 1.55;
    font-size: var(--text-sm);
    overflow-wrap: break-word;
}

.checkbox-row {
    margin-top: 4px;
    margin-left: 6px;
    font-size: var(--text-sm);
    color: #334155;
    line-height: 1;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    margin: 0;
    line-height: 1.2;
    position: relative;
    top: -1px;
}

.checkbox-row input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

.password-help-box {
    padding: clamp(12px, 2vw, 16px);
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid #bfdbfe;
    border-radius: clamp(12px, 1.8vw, 14px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.password-help-title {
    margin-bottom: 10px;
    font-weight: bold;
    color: #1d4ed8;
    font-size: var(--text-sm);
}

.password-help-box ul {
    margin: 0;
    padding-left: 18px;
}

.password-help-box li {
    margin-bottom: 6px;
    color: #334155;
    line-height: 1.5;
    font-size: var(--text-sm);
}

.password-help-box li:last-child {
    margin-bottom: 0;
}

.password-help-box p {
    margin: 12px 0 0;
}

.info-text {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    max-width: 700px;
    font-size: var(--text-sm);
    text-align: center;
    align-self: center;
}

.button,
button {
    width: min(100%, 420px);
    align-self: center;
    padding: clamp(12px, 1.8vw, 14px) clamp(18px, 2vw, 22px);
    border: none;
    border-radius: clamp(10px, 1.6vw, 12px);
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    font-size: var(--text-sm);
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.button:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.28);
}

.button:disabled,
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.forgot-password {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    font-size: var(--text-sm);
    text-align: center;
}

.forgot-password button {
    margin-top: 10px;
}

@media (max-width: 1200px) {
    .page-shell {
        width: min(100%, var(--page-max-width));
    }

    .top-logo {
        right: clamp(8px, 2vw, 16px);
    }
}

@media (max-width: 860px) {
    .page-shell {
        padding-top: clamp(72px, 14vw, 92px);
    }

    .top-logo {
        top: 0;
        right: 0;
    }

    .top-logo img {
        width: clamp(110px, 30vw, 170px);
        max-width: 42vw;
    }

    .page-wrapper {
        margin-top: 0;
        padding: clamp(18px, 4vw, 28px);
    }

    /*See above. I tried cleaning this up, but things went wrong */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
        background: #ffffff;
        padding: clamp(14px, 3vw, 18px);
        border-bottom: 1px solid #e5e7eb;
    }

    .form-row:last-child {
        border-bottom: none;
    }

    .form-cell {
        padding: 0;
        background: transparent;
    }

    .form-row > .form-cell + .form-cell {
        margin-top: 12px;
    }

    .button,
    button {
        width: 100%;
    }
}
    