/* Yleinen fontti lomake-elementeille */
input, textarea, select, button {
  font-family: 'Inter', sans-serif;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
 background-image: url('pilvikuva.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Pehmeä overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.4);
  z-index: -1;
  backdrop-filter: blur(2px);
  opacity: 0;
  animation: fadeInOverlay 1.2s ease forwards;
}

/* Fade-animaation avainkehykset */
@keyframes fadeInOverlay {
  to {
    opacity: 1;
  }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #000000; /* Dark blue-gray */
    text-align: center;
    margin-bottom: 30px;
}

.section-title {
  padding: 10px 0;
  margin: 20px 0 15px 0;
  font-weight: 700;
  font-size: 20px;
  color: #0e1c29;
  border-left: 4px solid #0e1c29;
  padding-left: 8px;
}

/* Character counter styles */
.character-counter {
    font-size: 14px;
    color: #666;
    text-align: right;
    margin-top: 5px;
    font-weight: 500;
}

.character-counter.warning {
    color: #e74c3c;
}

/* Additional styles remain the same... */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: #000000 ; /* Dark grayish blue */
    margin-bottom: 8px;
    font-size: 18px;
}

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 18px;
    transition: all 0.3s ease;
    background: #ffffff; /* Light background */
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
input[type="color"],
select,
textarea {
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 18px;
  transition: all 0.3s ease;
  background: #ffffff;
  box-sizing: border-box;
  color: #000;
}

input[type="color"],
select {
  -webkit-appearance: none;
  appearance: none;
}

/* Focus-tyyli kaikille */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
input[type="color"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0e1c29;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 28, 41, 0.1);
}


textarea {
    resize: vertical;
    min-height: 80px;
}

button {
  background-color: #774be5;
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 24px;
  font-weight: 300;
  width: 100%;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #774be5;
  color: #ffffff;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(119, 75, 229, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.button-primary:hover {
  background-color: #683dd7;
  box-shadow: 0 6px 16px rgba(119, 75, 229, 0.5);
  transform: translateY(-1px);
  font-weight: 500;
}


.button-primary:active {
  background-color: #5b34c0;
  transform: translateY(0);
}


button:hover {
    background-color: #000000; 
}

button:disabled {
    background-color: #5b34c0; 
    cursor: not-allowed;
}

/* Responsive styling */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    textarea {
        font-size: 20px;
    }
}
input[type="color"] {
  width: 100%;
  height: 50px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

input[type="color"]:focus {
  outline: none;
  border-color: #774be5;
  box-shadow: 0 0 0 3px rgba(119, 75, 229, 0.15);
}
input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 100%;
  height: 50px;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border: none;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

input[type="color"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(0, 0, 0, 0.3);
}
#color_value {
  font-size: 16px;
  font-weight: 500;
}

/* Piilota alkuperäinen input */
input[type="file"] {
  position: relative;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #ffffff;
  padding: 8px 12px;
  font-size: 16px;
  color: #0e1c29;
  cursor: pointer;
  box-sizing: border-box;
}

/* Muokkaa Choose file -napin tyyliä Webkit-selaimissa (Chrome, Safari) */
input[type="file"]::-webkit-file-upload-button {
  background-color: #0e1c29;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

/* Hover-efekti */
input[type="file"]::-webkit-file-upload-button:hover {
  background-color: #222;
}

/* Firefox */
input[type="file"]::file-selector-button {
  background-color: #0e1c29;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
  background-color: #222;
}
input[type="file"] {
  color: #0e1c29;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 12px;
}
.section-divider {
  margin: 30px 0;
  border: none;
  border-top: 1px solid #ddd;
}

/* Product rows styling */
.product-row {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
}

.product-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.product-row-header h4 {
  margin: 0;
  color: #774be5;
  font-size: 16px;
  font-weight: 600;
}

.remove-product-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #f8f9fa;
  color: #666;
  border: 1px solid #e0e0e0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.remove-product-btn:hover {
  background: #774be5;
  color: white;
  border-color: #774be5;
  transform: scale(1.1);
}

.add-product-btn {
  background: #ffffff;
  color: #774be5;
  border: 2px dashed #774be5;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.add-product-btn:hover {
  background: #774be5;
  color: white;
  border-color: #774be5;
}

.product-total {
  text-align: right;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.total-label {
  font-weight: 600;
  color: #555;
}

.total-amount {
  font-weight: 700;
  color: #774be5;
  font-size: 18px;
}

.invoice-summary {
  background: #ffffff;
  border: 2px solid #774be5;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row.total-row {
  border-top: 2px solid #774be5;
  margin-top: 10px;
  padding-top: 15px;
  font-size: 18px;
  font-weight: 700;
}

.summary-label {
  color: #555;
  font-weight: 500;
}

.summary-value {
  color: #774be5;
  font-weight: 600;
}

.total-row .summary-label,
.total-row .summary-value {
  color: #774be5;
  font-weight: 700;
}

/* Footer styles */
footer nav a:hover {
    color: #333 !important;
    text-decoration: underline !important;
}