/* Base Layout CSS - Mobile First with Pastel Blue Theme */

/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables for Consistency - Vibrant Ocean Theme */
:root {
  /* Main Color Palette */
  --green-blue: #2364aa; /* Deep ocean blue */
  --picton-blue: #3da5d9; /* Bright blue */
  --verdigris: #73bfb8; /* Blue-green */
  --mikado-yellow: #fec601; /* Bright yellow */
  --pumpkin: #ea7317; /* Orange */

  /* Primary Colors */
  --primary-color: var(--picton-blue);
  --primary-dark: var(--green-blue);
  --primary-light: var(--verdigris);
  --primary-gradient: linear-gradient(
    135deg,
    var(--picton-blue) 0%,
    var(--verdigris) 100%
  );
  --accent-color: var(--mikado-yellow);

  /* Status Colors */
  --success-color: var(--verdigris);
  --error-color: #ff6b6b; /* Softer red that works with palette */
  --warning-color: var(--mikado-yellow);

  /* Text Colors */
  --text-primary: #1a1a1a; /* Very dark gray - better contrast */
  --text-secondary: #4a4a4a; /* Medium dark gray */
  --text-light: #6a6a6a; /* Medium gray */

  /* Background Colors */
  --background: #f8fcff; /* Very light blue-white */
  --background-light: #f0f9ff; /* Light blue tint */
  --background-gradient: linear-gradient(180deg, #f8fcff 0%, #f0f9ff 100%);

  /* Border Colors */
  --border: #d3d3d3; /* Light gray */
  --border-light: #e0e6ed; /* Very light gray */

  /* Typography */
  --font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 14px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --line-height: 1.5;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;

  /* Layout */
  --border-radius: 12px;
  --border-radius-sm: 6px;
  --shadow: 0 2px 8px rgba(61, 165, 217, 0.2);
  --shadow-lg: 0 4px 16px rgba(61, 165, 217, 0.3);

  /* Touch targets for mobile */
  --touch-target-min: 44px;
}

/* Base Typography */
html {
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--background-gradient);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Layout */
main {
  min-height: 100vh;
  padding: var(--spacing-md);
  max-width: 400px; /* Mobile-first: phone width */
  margin: 0 auto;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-size-xl);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: var(--font-size-lg);
}

/* Text Elements */
p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--green-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--primary-color);
  text-decoration: none;
}

/* Base Button Styles */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: var(--touch-target-min);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-gradient);
  border-color: var(--primary-color);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-lg);
  background: linear-gradient(
    135deg,
    var(--green-blue) 0%,
    var(--primary-color) 100%
  );
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--background-light);
  border-color: var(--primary-color);
}

.btn-block {
  width: 100%;
  display: block;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: white;
  border: 2px solid var(--border-light);
  border-radius: var(--border-radius);
  min-height: var(--touch-target-min);
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(61, 165, 217, 0.1);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(61, 165, 217, 0.25);
}

.form-control::placeholder {
  color: var(--text-light);
}

/* Message Styles */
.message {
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  border: 1px solid;
}

.message-error {
  background-color: rgba(255, 182, 193, 0.2);
  border-color: var(--error-color);
  color: #8b0000;
}

.message-success {
  background-color: rgba(144, 238, 144, 0.2);
  border-color: var(--success-color);
  color: #006400;
}

.message-warning {
  background-color: rgba(240, 230, 140, 0.2);
  border-color: var(--warning-color);
  color: #b8860b;
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Card/Container Styles */
.card {
  background: white;
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-small {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Spacing utilities */
.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: var(--spacing-xs);
}
.mt-2 {
  margin-top: var(--spacing-sm);
}
.mt-3 {
  margin-top: var(--spacing-md);
}
.mt-4 {
  margin-top: var(--spacing-lg);
}
.mt-5 {
  margin-top: var(--spacing-xl);
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: var(--spacing-xs);
}
.mb-2 {
  margin-bottom: var(--spacing-sm);
}
.mb-3 {
  margin-bottom: var(--spacing-md);
}
.mb-4 {
  margin-bottom: var(--spacing-lg);
}
.mb-5 {
  margin-bottom: var(--spacing-xl);
}

/* Responsive Design - Tablet and Desktop */
@media (min-width: 768px) {
  main {
    max-width: 500px;
    padding: var(--spacing-xl);
  }

  h1 {
    font-size: calc(var(--font-size-xl) * 1.2);
  }

  .card {
    padding: var(--spacing-xl);
  }
}
