/* Base Styles */
* {
    box-sizing: border-box;
}

/* Навигация */
.breadcrumb {
    width: 100%;
    max-width: 1000px;
    font-size: 12px;
    color: #727272;
    margin-bottom: 3rem;
    font-family: "Raleway", sans-serif;
}

.breadcrumb a {
    color: #727272;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: #242323;
}

.breadcrumb span {
    margin: 0 0.5rem;
}

.breadcrumb .active {
    color: #242323;
}

/* Основной контент */
.registration-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Raleway", sans-serif;
    min-height: 100vh;
    justify-content: center;
    margin: 0 auto;
    padding: 2rem 1rem;
}

h1 {
    font-size: 28px;
    font-weight: normal;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.5px;
    color: #242323;
}

.subtitle {
    color: #727272;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.4;
    max-width: 600px;
}

/* Форма */
form {
    width: 100%;
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #242323;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    height: 48px;
    border: 1px solid #ebebeb;
    padding: 0 1rem;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: "Raleway", sans-serif;
    border-radius: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #ffffff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #242323;
    box-shadow: 0 0 0 2px rgba(36, 35, 35, 0.1);
}

.password-container {
    position: relative;
}

/* Кнопка показа/скрытия пароля */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #727272;
    padding: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.password-toggle:hover {
    color: #242323;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.9);
}

.password-toggle svg {
    transition: all 0.3s ease;
}

.password-toggle.show-password .eye-open {
    display: none;
}

.password-toggle.show-password .eye-closed {
    display: block;
}

.password-toggle .eye-open {
    display: block;
}

.password-toggle .eye-closed {
    display: none;
}

/* Стили для чекбоксов */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    display: none;
}

.checkbox-group .custom-checkbox {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1px solid #ebebeb;
    background-color: #fff;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    min-width: 18px;
    min-height: 18px;
}

.checkbox-group input[type="checkbox"]:checked + .custom-checkbox {
    background-color: #242323;
    border-color: #242323;
}

.checkbox-group input[type="checkbox"]:checked + .custom-checkbox::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:focus + .custom-checkbox {
    box-shadow: 0 0 0 2px rgba(36, 35, 35, 0.1);
}

.checkbox-group input[type="checkbox"]:hover + .custom-checkbox {
    border-color: #242323;
}

/* Стили для ошибки чекбокса */
.checkbox-group.error .custom-checkbox {
    border-color: #e53935;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.checkbox-group.error input[type="checkbox"]:hover + .custom-checkbox {
    border-color: #e53935;
}

.error-message {
    color: #e53935;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    line-height: 1.3;
}

.checkbox-group .error-message {
    margin-left: 28px;
}

@keyframes shake {
    10%, 90% {
        transform: translateX(-1px);
    }
    20%, 80% {
        transform: translateX(2px);
    }
    30%, 50%, 70% {
        transform: translateX(-2px);
    }
    40%, 60% {
        transform: translateX(1px);
    }
}

.checkbox-group label {
    font-size: 14px;
    color: #727272;
    line-height: 1.4;
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
}

/* Стили для ссылки в тексте */
.checkbox-group label a {
    color: #242323;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.checkbox-group label a:hover {
    color: #000000;
}

/* Кнопка */
.submit-button {
    width: 100%;
    height: 50px;
    background-color: #242323;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-top: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
    font-family: "Raleway", sans-serif;
    font-weight: 500;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.submit-button:hover {
    background-color: #000000;
}

.submit-button:active {
    transform: scale(0.98);
}

/* Эффект волны при нажатии на кнопку */
.submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.submit-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Ссылка для входа */
.login-link {
    margin-top: 2rem;
    text-align: center;
}

.login-link a {
    color: #242323;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: "Raleway", sans-serif;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
    color: #000000;
}

/* Tablet Responsive Design */
@media (max-width: 1024px) {
    .registration-container {
        max-width: 700px;
        padding: 1.5rem;
    }

    .breadcrumb {
        margin-bottom: 2rem;
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .registration-container {
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 8vh;
        min-height: auto;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 0.75rem;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .breadcrumb {
        font-size: 11px;
        margin-bottom: 1.5rem;
    }

    form {
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    label {
        font-size: 13px;
        margin-bottom: 0.4rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        height: 52px;
        padding: 0 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Apple's recommended touch target */
    }

    .password-toggle {
        right: 10px;
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }

    .password-toggle svg {
        width: 18px;
        height: 18px;
    }

    .checkbox-group {
        gap: 8px;
    }

    .checkbox-group .custom-checkbox {
        width: 20px;
        height: 20px;
        margin-top: 1px;
        min-width: 20px;
        min-height: 20px;
    }

    .checkbox-group input[type="checkbox"]:checked + .custom-checkbox::after {
        left: 7px;
        top: 3px;
    }

    .checkbox-group label {
        font-size: 13px;
        line-height: 1.3;
    }

    .checkbox-group .error-message {
        margin-left: 28px;
        font-size: 11px;
    }

    .submit-button {
        height: 56px;
        font-size: 16px;
        margin-top: 1.5rem;
    }

    .login-link {
        margin-top: 1.5rem;
    }

    .login-link a {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .registration-container {
        padding: 0.75rem;
        padding-top: 6vh;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 12px;
        margin-bottom: 1.25rem;
    }

    .breadcrumb {
        font-size: 10px;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    label {
        font-size: 12px;
        margin-bottom: 0.3rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        height: 48px;
        padding: 0 0.75rem;
        font-size: 16px;
    }

    .password-toggle {
        right: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    .password-toggle svg {
        width: 16px;
        height: 16px;
    }

    .checkbox-group .custom-checkbox {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
    }

    .checkbox-group input[type="checkbox"]:checked + .custom-checkbox::after {
        left: 6px;
        top: 2px;
        width: 4px;
        height: 8px;
    }

    .checkbox-group label {
        font-size: 12px;
    }

    .checkbox-group .error-message {
        margin-left: 26px;
        font-size: 10px;
    }

    .submit-button {
        height: 52px;
        font-size: 15px;
    }

    .login-link a {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .registration-container {
        padding: 0.5rem;
    }

    h1 {
        font-size: 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
        height: 44px;
        padding: 0 0.625rem;
    }

    .password-toggle {
        right: 6px;
        min-width: 36px;
        min-height: 36px;
    }

    .submit-button {
        height: 48px;
    }
}

/* Landscape orientation for mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    .registration-container {
        padding-top: 2vh;
        padding-bottom: 2vh;
        justify-content: flex-start;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 11px;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .checkbox-group {
        margin-bottom: 0.75rem;
    }

    .submit-button {
        margin-top: 1rem;
    }

    .login-link {
        margin-top: 1rem;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        -webkit-appearance: none;
        border-radius: 0;
    }

    .submit-button {
        -webkit-appearance: none;
        border-radius: 0;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .password-toggle svg {
        width: 20px;
        height: 20px;
    }

    @media (max-width: 768px) {
        .password-toggle svg {
            width: 18px;
            height: 18px;
        }
    }
}

/* Focus states for accessibility */
@media (prefers-reduced-motion: no-preference) {
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus {
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }

    .submit-button:focus {
        outline: 2px solid #242323;
        outline-offset: 2px;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}