/* ==========================================
   KÝ IPA ONLINE - APPLE STYLE
   ========================================== */

/* === RESET & BASE === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* === MAIN APP CONTAINER === */
#app {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* === HERO SECTION === */
h1 {
  font-size: 48px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(90deg, #0084ff 30%, #ff6600 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 70px rgba(255, 159, 64, 0.9);
  margin-top: 20px;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.subtitle {
  text-align: center;
  color: #86868b;
  font-size: 21px;
  margin-bottom: 40px;
}

/* === CARD === */
.card {
  background: white;
  border-radius: 18px;
  padding: 40px;
  margin: 0 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* === FORM GROUPS === */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.2s;
  background: white;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.input-with-icon {
  position: relative;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #0071e3;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.input-with-icon input[type="text"],
.input-with-icon input[type="password"] {
  padding-left: 42px;
}

/* === FILE INPUT === */
.file-input-wrapper {
  position: relative;
  display: block;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-display {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 2px dashed #d2d2d7;
  border-radius: 10px;
  background: #fafafa;
  transition: all 0.2s;
  cursor: pointer;
}

.file-input-display:hover {
  border-color: #0071e3;
  background: #f0f7ff;
}

.file-input-display.has-file {
  border-style: solid;
  border-color: #0071e3;
  background: #f0f7ff;
}

.file-name {
  color: #86868b;
  font-size: 15px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-input-display.has-file .file-name {
  color: #0071e3;
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.file-icon svg {
  width: 18px;
  height: 18px;
  stroke: #0071e3;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === BUTTONS === */
.button-primary {
  width: 100%;
  padding: 16px;
  background: #0071e3;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 32px;
}

.button-primary:hover {
  background: #0077ed;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.button-primary:active {
  transform: translateY(0);
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.download-button {
  display: block;
  width: 100%;
  padding: 14px 32px;
  background: #0071e3;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
}

.download-button:hover {
  background: #0077ed;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.download-button.secondary {
  background: #f5f5f7;
  color: #0071e3;
}

.download-button.secondary:hover {
  background: #e8e8ed;
}

.button-reload {
  display: block;
  width: 100%;
  padding: 14px 32px;
  background: transparent;
  color: #0071e3;
  text-decoration: none;
  border: 2px solid #0071e3;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.button-reload:hover {
  background: #0071e3;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

/* === PROGRESS === */
.progress-section {
  text-align: center;
  padding: 32px 0;
}

.progress-text {
  font-size: 17px;
  color: #1d1d1f;
  margin-bottom: 16px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #e5e5e7;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0071e3, #00a3ff);
  transition: width 0.3s;
  border-radius: 3px;
}

.progress-percentage {
  font-size: 24px;
  font-weight: 600;
  color: #0071e3;
}

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

/* === DOWNLOAD SECTION === */
.download-section {
  text-align: center;
  padding: 24px 0;
}

/* === DIVIDER === */
.divider {
  height: 1px;
  background: #d2d2d7;
  margin: 24px 0;
}

@media (max-width: 768px) {
  /* App container mobile */
  h1 {
    font-size: 45px;
  }
  
  .subtitle {
    font-size: 28px;
  }
  
  .card {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  #app {
    padding: 12px;
  }

  h1 {
    font-size: 40px;
  }

  .subtitle {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .card {
    padding: 20px;
  }
}
