/**
 * registration.css — стили для окна регистрации
 * Стиль: как в inventory-shop.css (секция ИНВЕНТАРЬ)
 * matrix, L-уголки, линии frame, без скруглений
 */

/* === ЭКРАН РЕГИСТРАЦИИ === */
#registration-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 10000;
    overflow-y: auto;
    padding: 20px 15px;
    text-align: center;
    overflow-x: hidden;
}

#registration-screen[style*="display: block"] {
    display: block !important;
}

/* Фон с эффектом гиперпространства */
#registration-hyperspace-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* Контейнер формы */
.registration-container {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: 0 auto;
    padding: 0 10px 14px;
    box-sizing: border-box;
}

/* Заголовок */
.registration-title {
    margin-bottom: 16px;
    font-size: 26px;
    color: var(--fg);
    font-family: "Noto Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Форма */
.registration-form {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}

/* Рамка вокруг полей (от Handle до чекбокса) с L-уголками */
.registration-form-fields {
    position: relative;
    border: 1px solid rgba(var(--frame-rgb), 0.5);
    padding: 14px 14px;
    margin-bottom: 16px;
}

/* L-уголки для рамки полей */
.registration-form-fields::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--frame-color);
    border-left: 2px solid var(--frame-color);
    pointer-events: none;
    z-index: 10;
}

.registration-form-fields::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid var(--frame-color);
    border-right: 2px solid var(--frame-color);
    pointer-events: none;
    z-index: 10;
}

/* Поля формы */
.registration-field {
    width: 100%;
    margin: 4px 0;
    border-radius: 0 !important;
    text-align: left;
    box-sizing: border-box;
}

/* Лейблы - как inventory-label */
.registration-label {
    display: block;
    font-size: 14px;
    color: var(--fg);
    margin-bottom: 8px;
    font-weight: 500;
    font-family: "Noto Sans", sans-serif;
}

.registration-label a {
    color: var(--frame-color);
    text-decoration: none;
    transition: all 0.2s;
}

.registration-label a:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(76, 201, 240, 0.6);
    text-decoration: underline;
}

/* Инпуты - стилизованные под inventory-item с L-уголками */
.registration-input {
    position: relative;
    width: 100%;
    padding: 12px 14px;
    background: repeating-linear-gradient(
        45deg,
        rgba(var(--frame-rgb), 0.04),
        rgba(var(--frame-rgb), 0.04) 50px,
        rgba(0, 0, 0, 0.02) 50px,
        rgba(0, 0, 0, 0.02) 70px
    );
    border-top: 1px solid rgba(var(--frame-rgb), 0.5);
    border-bottom: 1px solid rgba(var(--frame-rgb), 0.5);
    border-left: none;
    border-right: none;
    border-radius: 0 !important;
    color: #fff;
    font-size: 15px;
    font-family: "Noto Sans", sans-serif;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.registration-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.registration-input:focus {
    outline: none;
    background: repeating-linear-gradient(
        45deg,
        rgba(var(--frame-rgb), 0.08),
        rgba(var(--frame-rgb), 0.08) 50px,
        rgba(0, 0, 0, 0.03) 50px,
        rgba(0, 0, 0, 0.03) 70px
    );
    box-shadow: 
        0 0 0 1px rgba(var(--frame-rgb), 0.3),
        inset 0 0 20px rgba(var(--frame-rgb), 0.05);
}

/* L-уголки для инпутов */
.registration-input::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--frame-color);
    border-left: 2px solid var(--frame-color);
    pointer-events: none;
}

.registration-input::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid var(--frame-color);
    border-right: 2px solid var(--frame-color);
    pointer-events: none;
}

/* Чекбокс - без рамки и уголков */
.registration-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--fg);
    cursor: pointer;
    user-select: none;
    font-family: "Noto Sans", sans-serif;
    padding: 12px 14px;
}

.registration-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--frame-color);
    flex-shrink: 0;
}

.registration-terms-link {
    color: var(--frame-color);
    text-decoration: none;
    transition: all 0.2s;
}

.registration-terms-link:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(76, 201, 240, 0.6);
    text-decoration: underline;
}

/* Ошибки */
.registration-error {
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid rgba(230, 57, 70, 0.4);
    border-radius: 0;
    padding: 10px 14px;
    color: #ff6b6b;
    font-size: 13px;
    margin: 4px 0;
    text-align: center;
    font-family: "Noto Sans", sans-serif;
}

/* Загрузка */
.registration-loading {
    text-align: center;
    color: var(--fg);
    font-size: 13px;
    padding: 10px 14px;
    margin: 4px 0;
    font-family: "Noto Sans", sans-serif;
}

.registration-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(var(--frame-rgb), 0.5);
    border-top-color: var(--frame-color);
    border-radius: 50%;
    animation: registration-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes registration-spin {
    to { transform: rotate(360deg); }
}

/* Контейнер кнопок */
.registration-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 auto;
    width: 100%;
    max-width: 540px;
}

/* Кнопки - как inventory-item.level-1 с L-уголками */
.registration-submit {
    position: relative;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 0 !important;
    text-align: left;
    background: repeating-linear-gradient(
        45deg,
        rgba(var(--frame-rgb), 0.04),
        rgba(var(--frame-rgb), 0.04) 50px,
        rgba(0, 0, 0, 0.02) 50px,
        rgba(0, 0, 0, 0.02) 70px
    );
    border-top: 1px solid rgba(var(--frame-rgb), 0.5);
    border-bottom: 1px solid rgba(var(--frame-rgb), 0.5);
    color: #fff;
    font-size: 15px;
    font-family: "Noto Sans", sans-serif;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* L-уголки для кнопок */
.registration-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--frame-color);
    border-left: 2px solid var(--frame-color);
    pointer-events: none;
}

.registration-submit::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid var(--frame-color);
    border-right: 2px solid var(--frame-color);
    pointer-events: none;
}

.registration-submit:hover {
    filter: brightness(1.1);
    background: repeating-linear-gradient(
        45deg,
        rgba(var(--frame-rgb), 0.08),
        rgba(var(--frame-rgb), 0.08) 50px,
        rgba(0, 0, 0, 0.03) 50px,
        rgba(0, 0, 0, 0.03) 70px
    ) !important;
}

.registration-submit:active {
    filter: brightness(1.15);
}

.registration-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

/* Вторичная кнопка */
.registration-submit-secondary {
    opacity: 0.8;
}

.registration-submit-secondary:hover {
    opacity: 1;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .registration-container {
        padding: 0 5px 10px;
    }

    .registration-title {
        font-size: 20px;
    }

    .registration-input,
    .registration-submit,
    .registration-checkbox-label {
        padding-left: 24px;
        font-size: 14px;
    }
}

/* Скрытие левого и правого меню на экране регистрации */
body.registration-visible #right-menu-overlay,
body.registration-visible #right-menu-strip-wrap,
body.registration-visible #right-menu-buttons,
body.registration-visible #right-menu-map-lock-popup,
body.registration-visible #left-menu-overlay,
body.registration-visible #left-menu-strip-wrap,
body.registration-visible #left-menu-buttons {
    display: none !important;
}
