/* ============================================
   AUTHENTICATION PAGES STYLES
   Биологический стиль + Морская тематика
   ============================================ */

:root {
    --primary: #1a8fb8;
    --primary-dark: #156a8a;
    --primary-light: #2db3e8;
    --secondary: #2ecc71;
    --ocean-deep: #0a2540;
    --ocean-mid: #1a4d6f;
    --ocean-light: #2a7ba8;
    --foam: #e8f4f8;
    --text-light: #ecf0f1;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Синий фон только для auth страниц (не для игры) */
body:not(:has(.canvas-wrapper)) {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a2540 0%, #1a4d6f 50%, #2a7ba8 100%) !important;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(46, 204, 113, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(52, 152, 219, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Floating Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.03));
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.15),
        inset -5px -5px 15px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(46, 204, 113, 0.1);
    animation: float 15s infinite ease-in-out;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    bottom: -80px;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 70%;
    bottom: -60px;
    animation-delay: 3s;
}

.bubble:nth-child(3) {
    width: 100px;
    height: 100px;
    left: 30%;
    bottom: -100px;
    animation-delay: 6s;
}

.bubble:nth-child(4) {
    width: 50px;
    height: 50px;
    left: 85%;
    bottom: -50px;
    animation-delay: 9s;
}

.bubble:nth-child(5) {
    width: 70px;
    height: 70px;
    left: 50%;
    bottom: -70px;
    animation-delay: 4s;
}

.bubble:nth-child(6) {
    width: 90px;
    height: 90px;
    left: 65%;
    bottom: -90px;
    animation-delay: 7s;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) scale(0.8);
        opacity: 0;
    }
}

/* Decorative Elements */
.auth-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(46, 204, 113, 0.15), transparent);
    border: 1px solid rgba(46, 204, 113, 0.2);
    box-shadow: 
        0 0 40px rgba(46, 204, 113, 0.2),
        inset 0 0 30px rgba(46, 204, 113, 0.1);
}

.deco-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation: rotate-slow 30s linear infinite;
}

.deco-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation: rotate-slow 25s linear infinite reverse;
}

.deco-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Auth Container */
.auth-container {
    position: fixed;
    top: 17%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    box-sizing: border-box;
}

.auth-window {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2.8rem 3rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.auth-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent);
}

.auth-window::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo/Header */
.auth-window h3 {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.7rem 0;
    text-align: center;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(46, 204, 113, 0.3);
    position: relative;
    z-index: 1;
}

.auth-window h3::before {
    content: '🧬';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: 
        drop-shadow(0 0 15px rgba(46, 204, 113, 0.8))
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    animation: float-gentle 3s ease-in-out infinite;
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Form Inputs */
.inputs {
    margin: 2rem 0;
}

.auth-input {
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: linear-gradient(145deg, rgba(10, 37, 64, 0.6), rgba(26, 79, 111, 0.4));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: var(--text-light);
    font-size: 1.05rem;
    transition: var(--transition);
    box-sizing: border-box;
    margin-bottom: 1.1rem;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.1);
}

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

.auth-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: linear-gradient(145deg, rgba(10, 37, 64, 0.7), rgba(26, 79, 111, 0.5));
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 0 0 3px rgba(26, 143, 184, 0.2),
        0 0 20px rgba(26, 143, 184, 0.3);
    transform: translateY(-1px);
}

.auth-input:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -1px 2px rgba(255, 255, 255, 0.15),
        0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
}

.checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--secondary);
    appearance: none;
    background: linear-gradient(145deg, rgba(10, 37, 64, 0.6), rgba(26, 79, 111, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.checkbox input[type="checkbox"]:checked {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 10px rgba(46, 204, 113, 0.4);
}

.checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.checkbox input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(255, 255, 255, 0.15);
}

.checkbox label {
    color: var(--foam);
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.auth-button {
    width: 100%;
    padding: 1.1rem 2.5rem;
    background: linear-gradient(145deg, #2ecc71 0%, #27ae60 50%, #229954 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 
        0 8px 24px rgba(46, 204, 113, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 32px rgba(46, 204, 113, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #32d77a 0%, #2ecc71 50%, #27ae60 100%);
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 12px rgba(46, 204, 113, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Description */
.description {
    text-align: center;
    color: var(--foam);
    font-size: 0.9rem;
    margin-top: 0.7rem;
    margin-bottom: 0.7rem;
    line-height: 1.6;
    opacity: 0.8;
}

/* Links */
.login {
    text-align: center;
    color: var(--foam);
    font-size: 0.95rem;
    margin-top: 1.6rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.login a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.login a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--secondary));
    transition: width 0.3s ease;
    box-shadow: 0 0 8px currentColor;
}

.login a:hover {
    color: var(--secondary);
}

.login a:hover::after {
    width: 100%;
}

/* Messages */
.modal-error,
.modal-success {
    padding: 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.6rem;
    font-size: 0.95rem;
    text-align: center;
    animation: slideDown 0.3s ease-out;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

.modal-error {
    background: linear-gradient(145deg, rgba(231, 76, 60, 0.25), rgba(192, 57, 43, 0.15));
    border: 1px solid rgba(231, 76, 60, 0.6);
    color: #ff8787;
    box-shadow: 
        0 4px 12px rgba(231, 76, 60, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-error::before {
    content: '⚠️';
    margin-right: 0.5rem;
    filter: drop-shadow(0 0 4px rgba(231, 76, 60, 0.6));
}

.modal-success {
    background: linear-gradient(145deg, rgba(46, 204, 113, 0.25), rgba(39, 174, 96, 0.15));
    border: 1px solid rgba(46, 204, 113, 0.6);
    color: #5edb9a;
    box-shadow: 
        0 4px 12px rgba(46, 204, 113, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-success::before {
    content: '✓';
    margin-right: 0.5rem;
    font-weight: bold;
    filter: drop-shadow(0 0 4px rgba(46, 204, 113, 0.6));
}

/* Clearfix */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Preloader */
.preloader.hidden,
.preloader-bg.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .auth-window {
        padding: 2rem 1.5rem;
    }
    
    .auth-window h3 {
        font-size: 1.75rem;
    }
    
    .auth-window h3::before {
        font-size: 2.5rem;
    }
}

@media (max-height: 750px) {
    .auth-window {
        padding: 1.75rem 2.25rem;
    }
    
    .auth-window h3 {
        font-size: 1.6rem;
    }
    
    .auth-window h3::before {
        font-size: 2.25rem;
        margin-bottom: 0.5rem;
    }
    
    .inputs {
        margin: 1.25rem 0;
    }
    
    .auth-input {
        padding: 0.75rem 1.15rem;
        margin-bottom: 0.75rem;
    }
    
    .login {
        margin-top: 1rem;
    }
}

@media (max-height: 650px) {
    .auth-window {
        padding: 1.5rem 2rem;
    }
    
    .auth-window h3 {
        font-size: 1.5rem;
    }
    
    .auth-window h3::before {
        font-size: 2rem;
        margin-bottom: 0.4rem;
    }
    
    .inputs {
        margin: 1rem 0;
    }
    
    .auth-input {
        padding: 0.7rem 1rem;
        margin-bottom: 0.7rem;
        font-size: 0.95rem;
    }
    
    .auth-button {
        padding: 0.75rem 1.75rem;
        font-size: 1rem;
    }
    
    .login {
        margin-top: 0.875rem;
        font-size: 0.85rem;
    }
    
    .checkbox {
        margin-bottom: 1rem;
    }
}

/* Additional decorative elements */
.auth-window::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        rgba(46, 204, 113, 0.3) 0%, 
        rgba(26, 143, 184, 0.3) 50%, 
        rgba(52, 152, 219, 0.3) 100%);
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.auth-window:hover::before {
    opacity: 1;
}
