/* ==========================================
   MineAI - Сучасний стиль
   ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0a0e1a;
  --color-surface: #151b2e;
  --color-surface-light: #1e2740;
  --color-text: #e8eef7;
  --color-text-secondary: #9ca8bd;
  --color-text-muted: #6b7589;
  --color-primary: #00d9a3;
  --color-primary-hover: #00c493;
  --color-accent: #ff6b35;
  --color-border: #2a3548;
  --color-success: #00d9a3;
  --color-error: #ff6b6b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.page-container {
  min-height: 100vh;
  position: relative;
  display: flex;
}

/* Animated Background */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 30%, rgba(0, 217, 163, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 70%, rgba(255, 107, 53, 0.08) 0%, transparent 50%);
}

.shape {
  position: absolute;
  width: 400px;
  height: 400px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation: float 20s infinite ease-in-out;
  opacity: 0.03;
}

.shape1 {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape2 {
  background: linear-gradient(225deg, var(--color-accent), var(--color-primary));
  bottom: 10%;
  right: 10%;
  animation-delay: -7s;
  width: 300px;
  height: 300px;
}

.shape3 {
  background: linear-gradient(315deg, var(--color-primary), var(--color-accent));
  top: 50%;
  left: 50%;
  animation-delay: -14s;
  width: 500px;
  height: 500px;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(30px, -30px) rotate(90deg); }
  50% { transform: translate(-20px, 20px) rotate(180deg); }
  75% { transform: translate(20px, 30px) rotate(270deg); }
}

/* Main Layout */
.main-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* Brand Section */
.brand-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  position: relative;
}

.logo-container {
  margin-bottom: 3rem;
  position: relative;
}

.logo-animated {
  width: 120px;
  height: 120px;
  position: relative;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.logo-shape {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 80px solid var(--color-primary);
  filter: drop-shadow(0 8px 32px rgba(0, 217, 163, 0.3));
  animation: shapeGlow 2s ease-in-out infinite alternate;
}

@keyframes shapeGlow {
  from { filter: drop-shadow(0 8px 32px rgba(0, 217, 163, 0.3)); }
  to { filter: drop-shadow(0 8px 48px rgba(0, 217, 163, 0.6)); }
}

.logo-shape:nth-child(1) {
  left: 0;
  transform-origin: bottom;
  transform: rotate(-15deg);
  border-bottom-color: var(--color-primary);
}

.logo-shape:nth-child(2) {
  left: 25px;
  transform-origin: bottom;
  border-bottom-color: var(--color-accent);
  animation-delay: -0.5s;
}

.logo-shape:nth-child(3) {
  left: 50px;
  transform-origin: bottom;
  transform: rotate(15deg);
  border-bottom-color: #ffa05c;
  animation-delay: -1s;
}

.brand-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 300;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 217, 163, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.feature:hover {
  background: rgba(0, 217, 163, 0.05);
  border-color: rgba(0, 217, 163, 0.3);
  transform: translateX(8px);
}

.feature-icon {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 20px var(--color-primary);
}

/* Auth Section */
.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 4px;
  background: var(--color-surface-light);
  border-radius: 12px;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  background: none;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  background: var(--color-bg);
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Forms */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.auth-form h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--color-text), var(--color-text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface-light);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-bg);
  box-shadow: 0 0 0 4px rgba(0, 217, 163, 0.1);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 2.5rem;
  width: 24px;
  height: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.3s;
  background: none;
  border: none;
}

.toggle-password:hover {
  color: var(--color-primary);
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s;
}

.checkbox-label input:checked + .checkmark {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.checkbox-label input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--color-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s;
}

.forgot-link:hover {
  color: var(--color-primary-hover);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: var(--color-bg);
  box-shadow: 0 8px 24px rgba(0, 217, 163, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 217, 163, 0.4);
}

.btn-google {
  background: var(--color-surface-light);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-google:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* Messages */
.message {
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-top: 1rem;
  animation: fadeIn 0.3s ease;
  border-left: 4px solid;
}

.message.hidden {
  display: none;
}

.message.success {
  background: rgba(0, 217, 163, 0.1);
  color: var(--color-success);
  border-color: var(--color-success);
}

.message.error {
  background: rgba(255, 107, 107, 0.1);
  color: var(--color-error);
  border-color: var(--color-error);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 3rem;
  text-align: center;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
}

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

.modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-icon.success {
  background: rgba(0, 217, 163, 0.15);
  color: var(--color-success);
}

.modal-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

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

.modal-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 3;
}

.modal-content h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.token-info {
  background: var(--color-surface-light);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  margin: 1.5rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  word-break: break-all;
  max-height: 100px;
  overflow-y: auto;
  text-align: left;
}

.modal-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

/* Loading */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .brand-section {
    display: none;
  }
}

@media (max-width: 500px) {
  .auth-container {
    padding: 2rem 1.5rem;
  }
  
  .brand-title {
    font-size: 2.5rem;
  }
}