:root {
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", system-ui,
    sans-serif;
  color: #222;
  background-color: #f5f6fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f0f4ff 100%);
}

.app-store {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px 40px;
}

.top-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.letter-nav {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #dfe3ee;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.letter-nav button {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #3b4cca;
}

.letter-nav button:focus-visible,
.letter-nav button:hover {
  background: #e5e7ff;
}

.search-login {
  flex: 1 1 520px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e1e5ef;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#searchInput {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d0d4e2;
  font-size: 1rem;
}

#loginButton {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

#loginButton:hover {
  background: #2563eb;
}

.welcome {
  font-size: 0.95rem;
  color: #0b0f2c;
}

.hidden {
  display: none;
}

.login-options {
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e3e8f3;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.signup-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed #d0d4e2;
  background: #f9fafb;
}

.signup-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #0f172a;
}

.signup-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signup-card label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: #475467;
  gap: 6px;
}

.signup-card input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c8cfdc;
  font-size: 0.95rem;
  background: #fff;
}

.signup-card button {
  align-self: flex-end;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.signup-card button:hover {
  background: #1d4ed8;
}

.signup-feedback {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #dc2626;
}

.signup-feedback.success {
  color: #0f9d58;
}

.local-login {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #d0d4e2;
  background: #f8fafc;
}

.local-login h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #0f172a;
}

.local-login form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.local-login label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: #475467;
  gap: 6px;
}

.local-login input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c8cfdc;
  font-size: 0.95rem;
  background: #fff;
}

.local-login-feedback {
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: #be123c;
}

.local-login-actions {
  display: flex;
  gap: 10px;
}

.local-login-actions button {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.local-login-actions button[type="submit"] {
  background: #2563eb;
  color: #fff;
}

.local-login-actions button[type="button"] {
  background: #e5e7eb;
  color: #0f172a;
}

.login-details {
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #d1d6e7;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.login-details h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #0f172a;
}

.login-details p {
  margin: 2px 0;
  color: #475467;
  font-size: 0.95rem;
}

.login-options-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.login-options button {
  flex: 1;
  min-width: 140px;
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

[data-provider="google"] {
  background: #db4437;
  color: #fff;
}

[data-provider="naver"] {
  background: #1ec800;
  color: #fff;
}

.login-options p {
  margin: 0;
  color: #475467;
}

.add-app {
  margin-top: 24px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e3e8f3;
}

.add-app h2 {
  margin-top: 0;
}

.add-app p {
  margin: 8px 0 16px;
  color: #475467;
}

.add-app button {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background: #10b981;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35);
}

.add-app button:hover {
  background: #05916c;
}

.app-detail {
  margin-top: 24px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #d0d4e2;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.app-detail.hidden {
  display: none;
}

.app-detail-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.detail-label {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #838fa6;
  letter-spacing: 0.06em;
}

.app-detail-card h3 {
  margin: 4px 0 12px;
  font-size: 1.3rem;
  color: #0f172a;
}

.detail-description {
  margin: 0 0 10px;
  color: #475467;
  line-height: 1.6;
}

.detail-file-info {
  margin: 0 0 12px;
  color: #1d4ed8;
  font-weight: 600;
}

.detail-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.detail-download-btn:hover:not(.disabled) {
  background: #1e40af;
}

.detail-download-btn.disabled {
  background: #e5e7eb;
  color: #94a3b8;
  pointer-events: none;
}

.detail-steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.detail-steps li {
  padding-left: 14px;
  border-left: 3px solid #a5b4fc;
  color: #475467;
  font-size: 0.9rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  z-index: 40;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  width: min(420px, calc(100% - 32px));
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  color: #475467;
}

.modal-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-panel label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  color: #334155;
  gap: 6px;
}

.modal-panel input[type="text"],
.modal-panel textarea,
.modal-panel input[type="file"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c8cfdc;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fdfdff;
}

.modal-panel textarea {
  resize: vertical;
}

.file-info {
  margin: 0;
  font-size: 0.85rem;
  color: #475467;
}

.modal-feedback {
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: #be123c;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.modal-actions button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions button[type="submit"] {
  background: #2563eb;
  color: #fff;
}

.modal-actions button[type="button"] {
  background: #e5e7eb;
  color: #0f172a;
}

.app-list {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.letter-section {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #e3e8f3;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.letter-section h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #111827;
}

.apps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apps button {
  padding: 8px 12px;
  border: 1px solid #dfe3ee;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 500;
}

.apps button:hover {
  border-color: #3b82f6;
}

.empty {
  font-size: 0.9rem;
  color: #6b7280;
}

.app-list .highlight {
  background: #e0f2fe;
}

@media (max-width: 768px) {
  .top-row {
    flex-direction: column;
  }

  .search-row {
    flex-direction: column;
  }

  #loginButton {
    width: 100%;
  }

}
