:root {
  --primary-color: #1663b2;
  --accent-color: #4a90e2;
  --dark-color: #1a3e72;
  --light-color: #edf4fd;
  --white: #ffffff;
  --gray: #f5f7fa;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray);
  color: #1e293b;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.container {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 8px 30px rgba(0, 77, 155, 0.1);
  position: relative;
}

.logo-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  margin-right: 12px;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.language-selector {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 100;
}

.language-selector select {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: 0.2s;
}

.language-selector select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 6px rgba(74, 144, 226, 0.3);
  outline: none;
}

/* RTL support for Arabic language */
[dir="rtl"] .language-selector {
  left: 20px;
  right: auto;
}

/* 方向切换按钮样式 */
.direction-toggle {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 100;
}

.direction-toggle.hidden {
  display: none;
}

.direction-toggle button {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: 0.2s;
}

.direction-toggle button:hover {
  background-color: var(--light-color);
}

.direction-toggle #directionIcon {
  margin-right: 5px;
  font-size: 1rem;
}

/* RTL 状态下方向切换按钮的位置 */
[dir="rtl"] .direction-toggle {
  left: auto;
  right: 20px;
}

[dir="rtl"] .direction-toggle #directionIcon {
  margin-right: 0;
  margin-left: 5px;
}

h2 {
  text-align: center;
  color: var(--dark-color);
  margin-bottom: 10px;
}

p.sub {
  text-align: center;
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

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

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

input, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
  transition: 0.2s;
}

input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 6px rgba(74, 144, 226, 0.3);
  outline: none;
}

.form-group.hidden {
  display: none;
}

button.calculate-btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: linear-gradient(to right, var(--primary-color), var(--accent-color));
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
}

button.calculate-btn:hover {
  opacity: 0.95;
}

.result-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--light-color);
  border: 1px solid #dceeff;
  border-radius: 10px;
}

.result-section p {
  margin: 6px 0;
  color: var(--dark-color);
  font-weight: 500;
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 1.1rem;
  }
} 