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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --error: #ef4444;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --error: #ef4444;
    --bg: #111827;
    --bg-secondary: #1f2937;
    --text: #f9fafb;
    --text-secondary: #9ca3af;
    --border: #374151;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

/* Buttons */
.btn, .btn-primary, .btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 0.5rem 1rem;
}

.btn-text:hover, .btn-text:active {
  background: var(--bg-secondary);
}

/* Login Section */
.login-section {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

/* Cards */
.actions {
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
}

.card {
  display: block;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.card:hover, .card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  margin: 0;
}

/* Forms */
.form {
  max-width: 100%;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input[type="file"] {
  padding: 0.5rem;
}

/* Image Preview */
.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.image-preview img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

/* Messages */
.message, .error {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  font-weight: 500;
}

.message.success, .success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

.message.error, .error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid var(--error);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .container {
    padding: 0.75rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  .card-icon {
    font-size: 2.5rem;
  }

  .btn-primary {
    width: 100%;
  }
}

/* iOS safe area */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Touch optimization */
button, a, input, textarea {
  touch-action: manipulation;
}
