/* Reset and base styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Предотвращение горизонтального скролла */
html {
    overflow-x: hidden;
    max-width: 100%;
}

html, body {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #131416;
    font-family: Arial, sans-serif;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    max-width: 100%;
}

.wrapper {
    width: 100%;
    max-width: 380px;
    padding: 20px;
    margin: 0 auto;
    background: #202328;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

h1 {
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
    max-width: 380px;
    padding: 0 20px;
    box-sizing: border-box;
}

.form {
    width: 100%;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.form-group label[for="password"] {
    color: #666567;
}

.form-group input {
    width: 100%;
    height: 42px;
    padding: 0 15px;
    font-size: 16px;
    border: 1px solid #888888;
    border-radius: 8px;
    background: #2a2a2a;
    color: #ffffff;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.form-group input:hover,
.form-group input:focus {
    border-color: #4e7bb2;
    outline: none;
}

.form-group input::placeholder {
    color: #cccccc;
}

#password {
    color: #a1a09c;
}

#password.password-valid {
    color: #ffffff !important;
}

#password.is-invalid.password-valid {
    color: #ffffff !important;
}

.notice {
    font-size: 12px;
    line-height: 1.4;
    color: #888888;
    margin: 15px 0;
}

.notice a {
    color: #ffffff;
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    min-width: 14px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #ffffff;
    background-color: #3b3b3b;
    border: 1px solid #3b3b3b;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 3px;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #ffffff;
    border-color: #ffffff;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2c2c2c;
    font-size: 10px;
    font-weight: bold;
}

.checkbox-text {
    flex: 1;
}

.submit-button {
    width: 100%;
    height: 42px;
    margin: 20px auto 0;
    display: block;
    background: #4e7bb2;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.submit-button:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.submit-button.red {
    background: #ff0000;
}

.login-link {
    text-align: center;
    margin-top: 15px;
}

.login-link a {
    color: #ffffff;
    font-size: 15px;
    text-decoration: underline;
}

/* Мобильные устройства (до 480px) */
@media (max-width: 480px) {
    html, body {
        padding: 10px;
    }

    .wrapper {
        padding: 20px 15px;
        border-radius: 8px;
        max-width: 100%;
    }

    h1 {
        font-size: 28px;
        margin-bottom: 24px;
        padding: 0 15px;
        max-width: 100%;
    }

    .wrapper {
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-group label {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .form-group input {
        height: 44px;
        font-size: 16px;
        padding: 0 14px;
    }

    .submit-button {
        height: 44px;
        font-size: 16px;
        margin: 24px auto 0;
        border-radius: 8px;
    }

    .notice {
        font-size: 12px;
    }

    .login-link a {
        font-size: 15px;
    }
}

/* Очень маленькие мобильные устройства (до 360px) */
@media (max-width: 360px) {
    html, body {
        padding: 8px;
    }

    .wrapper {
        padding: 18px 12px;
        border-radius: 6px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
        padding: 0 12px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-group input {
        height: 40px;
        font-size: 15px;
        padding: 0 12px;
    }

    .submit-button {
        height: 40px;
        font-size: 15px;
        margin: 20px auto 0;
    }
}

/* Планшеты (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .wrapper {
        max-width: 400px;
        padding: 24px;
    }

    h1 {
        font-size: 34px;
        margin-bottom: 32px;
        max-width: 400px;
    }

    .form-group input {
        height: 44px;
        font-size: 17px;
    }

    .submit-button {
        height: 44px;
        font-size: 17px;
        margin-bottom: 0;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    html, body {
        padding: 5px;
    }

    .wrapper {
        padding: 15px;
        max-width: 100%;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group input {
        height: 40px;
        font-size: 15px;
    }

    .submit-button {
        height: 40px;
        margin: 15px auto 0;
    }

    .login-tabs {
        margin-top: -15px;
        margin-bottom: 12px;
    }
}

/* Десктоп (769px и выше) */
@media (min-width: 769px) {
    .wrapper {
        max-width: 400px;
        padding: 30px;
    }

    h1 {
        font-size: 36px;
        margin-bottom: 35px;
        max-width: 400px;
    }

    .form-group {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .form-group input {
        max-width: 360px;
        width: 100%;
    }

    .form-group label {
        width: 100%;
        max-width: 360px;
    }

    .submit-button {
        max-width: 360px;
        margin-bottom: 0;
    }
}

/* Большие экраны (1200px и выше) */
@media (min-width: 1200px) {
    .wrapper {
        max-width: 420px;
    }

    h1 {
        max-width: 420px;
    }

    .form-group {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .form-group input {
        max-width: 360px;
        width: 100%;
    }

    .form-group label {
        width: 100%;
        max-width: 360px;
    }

    .submit-button {
        max-width: 360px;
        margin-bottom: 0;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Grid system */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col {
    flex: 1;
    padding: 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

/* Forms */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Navigation */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--primary-color);
}

.nav-link:hover {
    color: #0056b3;
}

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.card-title {
    margin-bottom: 0.75rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Responsive utilities */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 14px;
    color: #c85555;
}

.invalid-feedback.feedback-valid {
    color: #ffffff !important;
}

.invalid-feedback .error-part {
    color: #c85555;
}

.invalid-feedback .error-part.valid {
    color: #ffffff;
}

.phone-input-wrapper {
    position: relative;
    width: 100%;
}

.phone-input-wrapper input {
    padding-right: 60px;
}

.phone-input-wrapper .error-icon {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #c85555;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

.phone-input-wrapper .clear-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.form-group input.is-invalid {
    border-color: #c85555;
    background: #392f2e;
}

.form-group input.is-invalid:focus {
    border-color: #c85555;
    outline: none;
}

.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

/* Alert messages */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Custom components */
.hero-section {
    padding: 4rem 0;
    background-color: var(--light-color);
    text-align: center;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Login tabs switcher */
.login-tabs {
    display: flex;
    gap: 0;
    margin-top: -20px;
    margin-bottom: 20px;
    border-bottom: 1px solid transparent;
}

.login-tab {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    font-weight: 400;
    padding: 12px 20px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    flex: 1;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.login-tab:hover {
    color: #aaa;
}


.login-tab.active {
    color: #ffffff;
}

.login-tab.active::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: #5282C1;
    border-radius: 3px 3px 0 0;
    z-index: 2;
}

/* Адаптивность переключателей */
@media (max-width: 480px) {
    .login-tabs {
        margin-top: -20px;
        margin-bottom: 18px;
    }

    .login-tab {
        font-size: 15px;
        padding: 12px 16px;
    }

    .login-tab.active::before {
        left: 18%;
        right: 18%;
        height: 3px;
    }
}

@media (max-width: 360px) {
    .login-tabs {
        margin-top: -18px;
        margin-bottom: 16px;
    }

    .login-tab {
        font-size: 14px;
        padding: 10px 12px;
    }

    .login-tab.active::before {
        left: 15%;
        right: 15%;
        height: 2.5px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .login-tab {
        font-size: 17px;
        padding: 14px 22px;
    }
}

@media (min-width: 769px) {
    .login-tab {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* Forgot password link */
.forgot-password {
    margin-top: 8px;
    text-align: left;
}

.forgot-password-link {
    color: #5282C1;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #6ba0e6;
    text-decoration: underline;
}

/* Register link */
.register-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}

.register-link span {
    color: #888;
}

.register-link a {
    color: #5282C1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #6ba0e6;
    text-decoration: underline;
} 