:root {
    --registration-primary: #4f46e5;
    --registration-primary-dark: #3730a3;
    --registration-ink: #172033;
    --registration-muted: #8290a5;
    --registration-border: #d4ddea;
    --registration-danger: #c93646;
    --registration-card: #ffffff;
    --registration-soft: #f6f8fc;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--registration-ink);
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, .11), transparent 30rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
}

.login-page,
.login-panel,
.registration-panel {
    width: 100%;
    min-width: 0;
}

.login-page {
    padding: 32px 20px;
}

.registration-panel {
    max-width: 1180px;
    margin: 0 auto;
}

.registration-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid #e3e9f1;
    border-radius: 18px;
    background: var(--registration-card);
    box-shadow: 0 20px 48px rgba(15, 23, 42, .09);
}

.registration-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    padding: 28px 28px 25px;
    border-bottom: 1px solid #e8edf4;
    background: linear-gradient(135deg, #ffffff 0%, #f5f6ff 100%);
    text-align: center;
}

.registration-logo {
    display: block;
    width: min(240px, 80%);
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
    object-fit: contain;
    transition: transform .3s ease;
}

.registration-logo:hover {
    transform: scale(1.03);
}

.registration-header h2 {
    margin: 0 0 7px;
    color: #24324a;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 800;
}

.registration-header p {
    margin: 0;
    color: var(--registration-muted);
    font-size: .8rem;
}

.registration-form {
    display: grid;
    gap: 18px;
    padding: 24px 28px 28px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.form-section {
    padding: 20px 22px 4px;
    border: 1px solid #e4eaf2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.section-title {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 18px;
    padding: 1px 0 13px 13px;
    border-bottom: 1px solid #e8edf4;
}

.section-title::before {
    content: "";
    position: absolute;
    top: 1px;
    bottom: 13px;
    left: 0;
    width: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}

.section-title > i {
    margin-top: 2px;
    color: var(--registration-primary);
    font-size: .9rem;
}

.section-title-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.section-title-copy strong {
    color: #24324a;
    font-size: .9rem;
    font-weight: 800;
}

.section-title-copy small {
    color: var(--registration-muted);
    font-size: .7rem;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px 24px;
    margin-bottom: 18px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    color: #3e4c63;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.3;
}

.form-label i {
    width: 14px;
    color: #7c8aa0;
    text-align: center;
}

.required {
    color: var(--registration-danger);
}

.input-icon {
    position: relative;
    width: 100%;
    min-width: 0;
}

.input-icon > i {
    position: absolute;
    top: 50%;
    right: 13px;
    color: #94a3b8;
    font-size: .8rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.input-icon .form-control {
    padding-right: 38px;
}

.form-control {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    padding: 0 13px;
    border: 1px solid var(--registration-border);
    border-radius: 11px;
    color: #334155;
    background-color: #fff;
    font-family: inherit;
    font-size: .84rem;
    line-height: 44px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

select.form-control {
    cursor: pointer;
}

.form-control::placeholder {
    color: #a0aabc;
}

.form-control:hover {
    border-color: #aebdd0;
}

.form-control:focus {
    border-color: #818cf8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
    outline: 0;
}

.form-group:has(.text-danger) .form-control,
.form-control.is-invalid {
    border-color: #dc6472;
    background: #fffafb;
}

.form-group:has(.text-danger) .form-control:focus,
.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .12);
}

.form-label-hint {
    margin-top: 7px;
    color: var(--registration-muted);
    font-size: .7rem;
    line-height: 1.45;
}

.text-danger {
    display: block;
    margin-top: 6px;
    color: var(--registration-danger);
    font-size: .7rem;
    font-weight: 700;
}

.password-requirements {
    padding: 14px 16px;
    margin: 0 0 18px;
    border: 1px solid #dddffc;
    border-radius: 12px;
    color: #475569;
    background: #f7f7ff;
    font-size: .74rem;
    animation: registrationSlideDown .2s ease;
}

.password-requirements strong {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    color: #3730a3;
    font-size: .77rem;
}

.requirements-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.requirements-list li {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
}

.requirement-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: transparent;
    background: #fff;
    font-size: .58rem;
}

.requirement-check.active {
    border-color: #22c55e;
    color: #15803d;
    background: #ecfdf3;
}

.terms-section {
    padding: 15px 17px;
    border: 1px solid #e4eaf2;
    border-radius: 12px;
    background: var(--registration-soft);
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-check-input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin-top: 1px;
    border: 1px solid #b9c5d5;
    border-radius: 5px;
    accent-color: var(--registration-primary);
    cursor: pointer;
}

.form-check-label {
    color: #475569;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    justify-self: end;
    min-width: 180px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--registration-primary);
    border-radius: 10px;
    color: #fff;
    background: var(--registration-primary);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .2);
    transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.btn-submit:hover,
.btn-submit:focus-visible {
    border-color: var(--registration-primary-dark);
    background: var(--registration-primary-dark);
    box-shadow: 0 11px 24px rgba(79, 70, 229, .3);
    outline: 0;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.registration-footer {
    padding: 17px 28px;
    border-top: 1px solid #e8edf4;
    color: #64748b;
    background: #fff;
    text-align: center;
    font-size: .76rem;
}

.registration-footer p {
    margin: 0;
}

.registration-footer a {
    color: var(--registration-primary);
    font-weight: 800;
    text-decoration: none;
}

.registration-footer a:hover {
    text-decoration: underline;
}

.alerts-container {
    margin: 18px 28px 0;
}

.registration-form .alerts-container {
    margin: 0;
}

.alerts-container .alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    margin: 0 0 9px;
    border: 1px solid #f2b8c0;
    border-radius: 10px;
    color: #a61b2b;
    background: #fff3f5;
    font-size: .75rem;
    font-weight: 700;
    animation: registrationSlideDown .2s ease;
}

@keyframes registrationSlideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .login-page {
        padding: 18px 12px;
    }

    .registration-header,
    .registration-form,
    .registration-footer {
        padding-right: 18px;
        padding-left: 18px;
    }

    .form-section {
        padding: 18px 17px 2px;
    }

    .form-row,
    .requirements-list {
        grid-template-columns: 1fr;
    }

    .btn-submit {
        width: 100%;
        justify-self: stretch;
    }
}

@media (max-width: 480px) {
    .registration-header {
        align-items: center;
        padding-top: 24px;
    }

    .registration-logo {
        width: min(210px, 82%);
        height: auto;
    }

    .registration-card {
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .registration-logo {
        transition: none;
    }
}
