:root {
    --brand: #2c66dd;
    --brand-dark: #1e4fb3;
    --brand-deep: #0f2a66;
    --ink: #1d2433;
    --muted: #6b7280;
    --line: #e3e7ef;
    --bg: #f4f6fb;
    --white: #ffffff;
    --danger: #d64545;
    --success: #1f9d6b;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(20, 40, 90, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

.page {
    display: flex;
    min-height: 100vh;
}

/* ---------- Brand panel ---------- */
.brand-panel {
    flex: 0 0 38%;
    max-width: 520px;
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.brand-panel::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.brand-inner {
    position: relative;
    z-index: 1;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 64px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    color: var(--brand);
    font-weight: 700;
    font-size: 22px;
    display: grid;
    place-items: center;
}

.brand-name {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.brand-headline {
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 18px;
}

.brand-sub {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 36px;
    max-width: 360px;
}

.brand-points {
    list-style: none;
    padding: 0;
    margin: 0 0 auto;
    display: grid;
    gap: 14px;
}

.brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7fffd4;
    flex: 0 0 auto;
}

.brand-footer {
    margin-top: 40px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* ---------- Form panel ---------- */
.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.form-card {
    width: 100%;
    max-width: 720px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
}

.form-head h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
}

.form-head p {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
}

.req {
    color: var(--danger);
}

/* ---------- Google Sign-In Section ---------- */
.google-signin-section {
    margin-bottom: 20px;
    text-align: center;
}

.btn-google {
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    color: #374151;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-google svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.google-user-info {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(31, 157, 107, 0.08);
    border: 1px solid rgba(31, 157, 107, 0.2);
    border-radius: 10px;
}

.google-user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.google-user-info span {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.btn-signout {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.btn-signout:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--line);
}

.divider span {
    padding: 0 16px;
    font-size: 13px;
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--ink);
}

input,
select,
textarea {
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 102, 221, 0.15);
}

input.invalid,
select.invalid,
textarea.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

/* ---------- Upload Area ---------- */
.upload-area {
    position: relative;
    border: 2px dashed var(--line);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fbfcfe;
}

.upload-area:hover {
    border-color: var(--brand);
    background: rgba(44, 102, 221, 0.03);
}

.upload-area.dragover {
    border-color: var(--brand);
    background: rgba(44, 102, 221, 0.08);
}

.upload-area.invalid {
    border-color: var(--danger);
    background: rgba(214, 69, 69, 0.03);
}

.upload-area input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.upload-text {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--ink);
}

.upload-link {
    color: var(--brand);
    font-weight: 600;
}

.upload-hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.upload-preview {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.upload-preview .file-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 16px;
    display: grid;
    place-items: center;
}

.upload-preview .file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-preview .remove-file {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.upload-preview .remove-file:hover {
    color: var(--danger);
    background: rgba(214, 69, 69, 0.1);
}

.resume-status {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
}

.resume-status.success {
    color: var(--success);
}

.resume-status.error {
    color: var(--danger);
}

.resume-status.warning {
    color: #b57d00;
}

.resume-status.loading {
    color: var(--brand);
}

/* ---------- Status ---------- */
.status {
    margin-top: 22px;
    font-size: 14px;
    padding: 0;
    border-radius: 10px;
    display: none;
}

.status.show {
    display: block;
    padding: 12px 16px;
}

.status.error {
    background: rgba(214, 69, 69, 0.1);
    color: var(--danger);
}

.status.success {
    background: rgba(31, 157, 107, 0.1);
    color: var(--success);
}

/* ---------- Actions ---------- */
.actions {
    margin-top: 28px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 26px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.btn-ghost:hover {
    background: #f4f6fb;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px rgba(44, 102, 221, 0.3);
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin 0.6s linear infinite;
}

.btn.loading .spinner {
    display: inline-block;
}

.btn.loading .btn-label {
    opacity: 0.85;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Account Section ---------- */
.account-section {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(44, 102, 221, 0.06) 0%, rgba(31, 157, 107, 0.04) 100%);
    border: 1px solid rgba(44, 102, 221, 0.15);
    border-radius: var(--radius);
}

.account-header {
    text-align: center;
    margin-bottom: 20px;
}

.account-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.account-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.account-header p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.account-section .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.account-section .field {
    display: flex;
    flex-direction: column;
}

.account-section .field label {
    margin-bottom: 6px;
}

.account-section .field input {
    width: 100%;
    box-sizing: border-box;
}

.account-form-wrapper {
    width: 100%;
}

.account-note {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(44, 102, 221, 0.06);
    border-left: 3px solid var(--brand);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.account-note strong {
    color: var(--ink);
}

/* ---------- Google Account Section ---------- */
.google-account-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--line);
}

.google-account-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

.google-account-section .grid {
    gap: 16px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-signed-in {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(31, 157, 107, 0.08);
    border: 1px solid rgba(31, 157, 107, 0.3);
    border-radius: 8px;
    font-size: 14px;
    color: var(--success);
}

.google-signed-in .google-check {
    font-weight: bold;
    font-size: 16px;
}

/* ---------- Account Error ---------- */
.account-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(214, 69, 69, 0.08);
    border: 1px solid rgba(214, 69, 69, 0.25);
    border-radius: 8px;
    font-size: 13px;
    color: var(--danger);
}

.account-error .error-icon {
    font-size: 14px;
}

/* ---------- Password Requirements ---------- */
.password-requirements {
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(44, 102, 221, 0.04);
    border: 1px solid rgba(44, 102, 221, 0.12);
    border-radius: 8px;
    font-size: 12px;
}

.password-requirements .req-title {
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
}

.password-requirements ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: var(--muted);
    transition: color 0.2s;
}

.password-requirements li .req-icon {
    font-size: 10px;
    width: 14px;
    text-align: center;
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.valid .req-icon {
    color: var(--success);
}

.password-requirements li.invalid {
    color: var(--danger);
}

.password-requirements li.invalid .req-icon {
    color: var(--danger);
}

/* ---------- Account Success ---------- */
.account-success {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(31, 157, 107, 0.08);
    border: 1px solid rgba(31, 157, 107, 0.25);
    border-radius: 10px;
}

.account-success .success-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.account-success .success-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-success .success-text strong {
    font-size: 14px;
    color: var(--success);
}

.account-success .success-text span {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Register Button Spinner ---------- */
.btn-google .btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(60, 64, 67, 0.3);
    border-top-color: #3c4043;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-google:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ---------- Submit Note ---------- */
.submit-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}

.submit-note.hidden {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .page {
        flex-direction: column;
    }
    .brand-panel {
        flex: none;
        max-width: none;
    }
    .brand-inner {
        padding: 40px 32px;
    }
    .brand-logo {
        margin-bottom: 32px;
    }
    .brand-headline {
        font-size: 28px;
    }
    .brand-points {
        margin-bottom: 8px;
    }
}

@media (max-width: 560px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .account-section .grid {
        grid-template-columns: 1fr;
    }
    .form-panel {
        padding: 24px 16px;
    }
    .form-card {
        padding: 26px 20px;
    }
    .actions {
        flex-direction: column-reverse;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
}
