/* 
 * @file styles.css
 * @description Paleta Institucional Bordó y estilos unificados BachiSystem V2 para SocialPoster
 * Colegio Secundario N° 5089
 */

:root {
  /* Bordó Institucional (Escudo y Uniforme) */
  --primary-color: #8b1e1e;
  --primary-hover: #6d1515;
  --primary-light: #fdf2f2;
  
  /* Verde Bosque (Estructura y marcos del Colegio) */
  --secondary-color: #1e4d3b;
  --secondary-hover: #14372a;
  
  /* Dorado Lapacho (Detalles institucionales) */
  --accent-color: #d97706;
  --accent-light: #fef3c7;
  
  --success-color: #059669;
  --danger-color: #dc2626;
  --warning-color: #d97706;
  --info-color: #2563eb;
  
  --bg-gradient: linear-gradient(135deg, #3d0c14 0%, #7a1c1c 100%);
  --bg-body: #faf7f7;
  --bg-card: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.96);
  
  --text-main: #1f1416;
  --text-muted: #6e5d61;
  --border-color: #eadede;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(122, 28, 28, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(122, 28, 28, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 20px 30px -10px rgba(139, 30, 30, 0.25);
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

[data-theme="dark"] {
  --bg-gradient: linear-gradient(135deg, #180407 0%, #3a0b12 100%);
  --bg-body: #0d0305;
  --bg-card: #1a0a0d;
  --bg-header: rgba(26, 10, 13, 0.96);
  
  --text-main: #fcf8f8;
  --text-muted: #a89498;
  --border-color: #3d1b22;
  
  --shadow-hover: 0 20px 30px -10px rgba(185, 28, 28, 0.35);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Header Navbar estilo BachiSystem */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  object-fit: cover;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

/* Main Content */
.main-wrapper {
  max-width: 820px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1;
}

/* Banner Hero */
.hero-card {
  background: var(--bg-gradient);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.hero-desc {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 600px;
}

/* Form Card */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.section-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label span.req {
  color: var(--danger-color);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary-color);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.15);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Upload Dropzone */
.dropzone-container {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.2rem;
  text-align: center;
  background: var(--bg-body);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dropzone-container:hover, .dropzone-container.drag-over {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--primary-color);
  margin: 0 auto 0.6rem;
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Photo Previews Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: #000;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-badge-first {
  position: absolute;
  top: 5px;
  left: 5px;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.preview-remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

.preview-remove-btn:hover {
  background: var(--danger-color);
}

/* Submit Button */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
  margin-top: 1.5rem;
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 380px;
  width: calc(100% - 3rem);
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }
.toast.info { border-left-color: var(--info-color); }

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

/* Footer */
.portal-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

