/* MAX Privacy Consent Shared Styles */

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

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  background-color: #fafafa;
  color: #3a3738;
  line-height: 1.6;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Page Loading State */
.page-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #999;
  font-size: 14px;
}

.page-loading.hidden {
  display: none;
}

/* Spinner Styles (LIFF) */
.spinner-box {
  position: absolute;
  top: 40%;
  width: 100%;
  height: 84px;
  margin-top: -42px;
  color: #4cc764;
  background: #fff;
}

.spinner {
  display: block;
  height: 84px;
  width: 84px;
  margin: 0 auto;
}

.spinner:after {
  display: block;
  animation: loader 1.2s linear infinite;
  border: 10px solid #fff;
  border-radius: 50%;
  content: " ";
  margin: 1px;
  height: 64px;
  width: 64px;
}

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

.spinner-box .spinner:after {
  border-color: #4cc764 transparent #4cc764 transparent;
}

/* Consent Modal (LIFF overlay) */
.consent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fafafa;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 1000;
  overflow-y: auto;
}

/* Consent Container */
.consent-container {
  max-width: 394px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 20px 32px 20px;
  gap: 40px;
}

.consent-container.hidden {
  display: none;
}

.consent-container.visible {
  display: flex;
}

/* Header */
.consent-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.consent-logo {
  width: 50px;
  height: 25px;
}

.consent-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.consent-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: #3a3738;
}

/* Content */
.consent-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.consent-description {
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: #3a3738;
  text-align: center;
}

.consent-description p {
  margin-bottom: 8px;
}

.consent-description p:last-child {
  margin-bottom: 0;
}

.privacy-link {
  color: #f06000;
  text-decoration: underline;
  font-size: 14px;
  line-height: 18px;
}

/* Error */
.consent-error {
  display: none;
  background-color: #FEE;
  border: 1px solid #FCC;
  border-radius: 4px;
  padding: 12px;
  color: #C00;
  text-align: center;
  font-size: 14px;
}

.consent-error.active {
  display: block;
}

/* Button Container */
.consent-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Consent Button */
.consent-button {
  background-color: #f06000;
  color: white;
  border: none;
  border-radius: 8px;
  height: 52px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 350px;
  max-width: 100%;
  transition: background-color 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
}

.consent-button:hover {
  background-color: #d85500;
}

.consent-button:active {
  background-color: #c04d00;
}

.consent-button:disabled {
  background-color: #CCCCCC;
  cursor: not-allowed;
}

.consent-link {
  text-decoration: none;
  color: white;
  display: flex;                /* ensure anchor centers like button */
  align-items: center;
  justify-content: center;
}

/* Loading */
.consent-loading {
  display: none;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.consent-loading.active {
  display: block;
}

/* Mobile Responsive */
@media (max-width: 375px) {
  .consent-container {
    padding: 32px 16px 24px 16px;
    gap: 32px;
  }

  .consent-logo {
    width: 40px;
    height: 20px;
  }

  .consent-title {
    font-size: 16px;
  }

  .consent-button {
    width: 100%;
  }
}
