/* ============================================
   税理士法人優和 - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
  --color-primary: #1a365d;
  --color-secondary: #c9a227;
  --color-accent: #3182ce;
  --color-white: #ffffff;
  --color-bg-light: #f7fafc;
  --color-text: #2d3748;
  --color-text-light: #718096;
  --color-border: #e2e8f0;
  --color-success: #38a169;
  --color-error: #e53e3e;
  --font-main: 'Hiragino Kaku Gothic Pro', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --max-width: 1200px;
  --header-height: 80px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-primary);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border-radius: 4px;
  transition: var(--transition);
  border: 2px solid transparent;
}

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

.btn-primary:hover {
  background-color: #b8922a;
  border-color: #b8922a;
  color: var(--color-white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.btn-accent:hover {
  background-color: #2c7bb8;
  border-color: #2c7bb8;
}

/* ============================================
   Header
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo span {
  color: var(--color-secondary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-text);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--color-primary);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--color-primary);
  transition: var(--transition);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d4a7c 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../assets/financial-services.jpg') center/cover no-repeat;
  opacity: 0.15;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  max-width: 700px;
}

.hero-title {
  font-size: 3rem;
  color: var(--color-white);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 5rem 0;
}

.section-light {
  background-color: var(--color-bg-light);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  margin-bottom: 1rem;
}

.section-title p {
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Services Cards
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  background-color: var(--color-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.service-card-image {
  height: 200px;
  overflow: hidden;
}

.service-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.service-card:hover .service-card-image img {
  transform: scale(1.05);
}

.service-card-content {
  padding: 1.5rem;
}

.service-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.service-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ============================================
   Features / Why Choose Us
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.feature-item {
  text-align: center;
  padding: 2rem 1rem;
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background-color: var(--color-bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-secondary);
}

.feature-item h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.feature-item p {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ============================================
   Process Steps
   ============================================ */
.process-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: 3rem;
}

.process-steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 10%;
  right: 10%;
  height: 2px;
  background-color: var(--color-border);
}

.process-step {
  flex: 1;
  text-align: center;
  position: relative;
  padding: 0 1rem;
}

.process-number {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background-color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
  position: relative;
  z-index: 1;
}

.process-step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.process-step p {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ============================================
   Forms
   ============================================ */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--color-white);
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-label .required {
  color: var(--color-error);
  margin-left: 0.25rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: var(--transition);
  background-color: var(--color-white);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

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

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0.125rem;
  accent-color: var(--color-accent);
}

.form-checkbox label {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.form-checkbox a {
  color: var(--color-accent);
  text-decoration: underline;
}

.form-submit {
  width: 100%;
  margin-top: 1rem;
}

.form-note {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ============================================
   Contact Page
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info {
  padding: 2rem;
}

.contact-info h2 {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background-color: var(--color-bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-secondary);
  font-size: 1.25rem;
}

.contact-details h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.contact-details p,
.contact-details a {
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.map-container {
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 2rem;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   About Page
   ============================================ */
.about-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d4a7c 100%);
  color: var(--color-white);
  padding: 8rem 0 5rem;
  text-align: center;
}

.about-hero h1 {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.about-content {
  padding: 4rem 0;
}

.about-section {
  margin-bottom: 4rem;
}

.about-section h2 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-secondary);
  display: inline-block;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.value-card {
  padding: 2rem;
  background-color: var(--color-bg-light);
  border-radius: 8px;
  text-align: center;
}

.value-card h3 {
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

/* ============================================
   Services Page
   ============================================ */
.services-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d4a7c 100%);
  color: var(--color-white);
  padding: 8rem 0 5rem;
  text-align: center;
}

.services-hero h1 {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--color-border);
}

.service-detail:last-child {
  border-bottom: none;
}

.service-detail:nth-child(even) {
  direction: rtl;
}

.service-detail:nth-child(even) > * {
  direction: ltr;
}

.service-detail-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.service-detail-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.service-detail-content h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.service-detail-content ul {
  margin: 1.5rem 0;
}

.service-detail-content li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.service-detail-content li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
}

/* ============================================
   Legal Pages (Privacy, Terms, etc.)
   ============================================ */
.legal-page {
  padding: 8rem 0 4rem;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h1 {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.legal-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.5rem;
}

.legal-content ul {
  list-style-type: disc;
}

.legal-content ol {
  list-style-type: decimal;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.last-updated {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: var(--color-white);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.footer-section p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--color-secondary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.footer-disclaimer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.footer-copyright {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Cookie Consent Banner
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.active {
  transform: translateY(0);
}

.cookie-banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-content {
  flex: 1;
  min-width: 300px;
}

.cookie-content p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.cookie-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-buttons .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

/* Cookie Settings Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal.active {
  display: flex;
}

.cookie-modal-content {
  background-color: var(--color-white);
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
}

.cookie-modal-header {
  margin-bottom: 1.5rem;
}

.cookie-modal-header h2 {
  margin-bottom: 0.5rem;
}

.cookie-modal-header p {
  color: var(--color-text-light);
  margin-bottom: 0;
}

.cookie-category {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cookie-category:last-child {
  border-bottom: none;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cookie-category-header h3 {
  font-size: 1rem;
  margin-bottom: 0;
}

.cookie-toggle {
  position: relative;
  width: 50px;
  height: 26px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: var(--transition);
  border-radius: 26px;
}

.cookie-toggle-slider::before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-white);
  transition: var(--transition);
  border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: var(--color-success);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  background-color: var(--color-accent);
  cursor: not-allowed;
}

.cookie-category p {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.cookie-modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.cookie-modal-buttons .btn {
  flex: 1;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .nav-list {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-white);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }
  
  .nav-list.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .services-grid,
  .features-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }
  
  .service-detail,
  .service-detail:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .process-steps {
    flex-direction: column;
    gap: 2rem;
  }
  
  .process-steps::before {
    display: none;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .cookie-banner .container {
    flex-direction: column;
    text-align: center;
  }
  
  .cookie-buttons {
    justify-content: center;
  }
  
  .form-container {
    padding: 1.5rem;
  }
  
  .section {
    padding: 3rem 0;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  z-index: 10001;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Cookie Table Styles */
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.cookie-table th,
.cookie-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--color-border);
}

.cookie-table th {
  background-color: var(--color-bg-light);
  font-weight: 600;
  color: var(--color-primary);
}

.cookie-table tr:nth-child(even) {
  background-color: var(--color-bg-light);
}

.cookie-table tr:hover {
  background-color: rgba(49, 130, 206, 0.05);
}

/* Print styles */
@media print {
  .header,
  .footer,
  .cookie-banner,
  .cookie-modal {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
}
