:root {
    --color-primary: #144241;
    --color-accent: #c4a35e;
    --color-bg: #f4f8f8;
    --color-surface: #ffffff;
    --color-text: #163436;
    --color-muted: #5f787a;
    --color-border: #d7e2e2;
    --shadow-soft: 0 14px 34px rgba(20, 66, 65, 0.08);
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(160deg, #edf4f4, #ffffff 50%, #edf4f4);
    color: var(--color-text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(460px, 100%);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    padding: 26px;
}

.auth-card-register {
    width: min(700px, 100%);
}

.auth-header {
    display: grid;
    justify-items: center;
    text-align: center;
    margin-bottom: 18px;
}

.auth-logo-link {
    display: inline-block;
}

.auth-logo {
    height: 72px;
    width: auto;
    display: block;
}

.auth-title {
    margin: 12px 0 4px;
    color: var(--color-primary);
    font-size: 1.25rem;
}

.auth-subtitle {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.94rem;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-grid {
    display: grid;
    gap: 14px;
}

.auth-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.auth-grid .full-span {
    grid-column: 1 / -1;
}

.auth-alert {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #245457;
}

.form-group {
    display: grid;
    gap: 6px;
    align-content: start;
}

.form-group label {
    font-size: 0.91rem;
    font-weight: 600;
    color: #284b4d;
}

.label-with-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inline-hint {
    font-size: 0.74rem;
    color: #446164;
    background: #edf5f5;
    border: 1px solid #d4e2e2;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.form-control {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    min-height: 42px;
    height: 42px;
    padding: 0 12px;
    font-size: 0.94rem;
    color: var(--color-text);
    background: #ffffff;
    box-sizing: border-box;
}

.form-control[type="date"] {
    padding-right: 10px;
    line-height: 1.2;
    appearance: none;
}

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 8px 12px;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(20, 66, 65, 0.12);
    outline: none;
}

.form-control.is-invalid {
    border-color: #cf4f4f;
    box-shadow: 0 0 0 3px rgba(207, 79, 79, 0.12);
}

.form-error-client {
    margin-top: 6px;
}

.form-control[readonly] {
    background: #f4f8f8;
    color: #365759;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: #406164;
    cursor: pointer;
}

.password-toggle:hover {
    background: rgba(20, 66, 65, 0.08);
}

.form-check label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #35575a;
    font-size: 0.92rem;
}

.form-error {
    margin: 0;
    color: #8f1f1a;
    font-size: 0.83rem;
    background: #fdeeee;
    border: 1px solid #f3c8c5;
    border-radius: 7px;
    padding: 6px 8px;
}

.form-hint {
    margin: 0;
    color: #5f787a;
    font-size: 0.8rem;
}

.step-panel-intro {
    border: 1px solid #dce8e8;
    background: #f6fbfb;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
}

.step-panel-intro h3 {
    margin: 0;
    font-size: 0.94rem;
    color: #1b484a;
}

.step-panel-intro p {
    margin: 4px 0 0;
    color: #5a7476;
    font-size: 0.82rem;
}

.register-steps-wrap {
    display: flex;
    justify-content: center;
}

.register-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.register-step {
    border: 1px solid #d4e2e2;
    border-radius: 12px;
    background: #f4f8f8;
    color: #527274;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.step-index {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #c7d8d8;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.step-text {
    line-height: 1;
}

.register-step-arrow {
    color: #6f888a;
    font-size: 0.9rem;
}

.register-step.is-active {
    border-color: #1c4f50;
    background: #e7f1f1;
    color: #184647;
}

.register-step.is-active .step-index {
    border-color: #1c4f50;
    color: #ffffff;
    background: #1c4f50;
}

.auth-actions-step {
    margin-top: 2px;
}

.verification-card {
    border: 1px solid #d8e5e5;
    border-radius: 12px;
    background: #f8fcfc;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.verification-title {
    margin: 0;
    color: #173f42;
    font-size: 1.05rem;
}

.verification-copy {
    margin: 0;
    color: #587375;
    font-size: 0.88rem;
}

.verification-info {
    border-color: #c8e2ce;
    background: #edf9f0;
    color: #236d36;
}

.verification-info p {
    margin: 0;
}

.verification-success {
    border-color: #b8dfc1;
    background: #ecf9ef;
    color: #1f6d35;
}

.verification-success p {
    margin: 0;
}

.btn-secondary {
    border: 1px solid #c6d8d8;
    border-radius: 9px;
    background: #ffffff;
    color: #1a4b4c;
    min-height: 42px;
    padding: 0 18px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f3f8f8;
}

.form-error-summary {
    margin: 0;
    border: 1px solid #f1c8c6;
    background: #fff2f2;
    color: #8f1f1a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.86rem;
}

.form-error-summary p {
    margin: 0 0 6px;
    font-weight: 600;
}

.form-error-summary ul {
    margin: 0;
    padding-left: 18px;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary {
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--color-primary);
    color: #ffffff;
    min-height: 42px;
    padding: 0 18px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #0f3635;
}

.text-link {
    color: var(--color-primary);
    font-size: 0.9rem;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.auth-bottom-text {
    margin: 2px 0 0;
    color: #537072;
    font-size: 0.9rem;
}

@media (max-width: 520px) {
    .auth-grid.two-col {
        grid-template-columns: 1fr;
    }

    .auth-grid .full-span {
        grid-column: auto;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-actions {
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
    }

    .register-steps {
        justify-content: center;
    }

    .register-step-arrow {
        display: none;
    }
}

@media (max-width: 980px) {
    .auth-card-register {
        width: min(600px, 100%);
    }
}
