/* Material Design inspired styles for frontend form */
.vk-cf-form {
  max-width: 700px;
  background: #ffffff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.submit-another {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(45deg, #1976d2, #1565c0);
  color: white;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.submit-another:hover {
  background: linear-gradient(45deg, #1565c0, #0d47a1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* Textarea specific styling */
.vk-cf-field textarea {
  min-height: 80px;
  resize: vertical;
  padding-top: 24px;
}

.vk-cf-field textarea + label {
  top: 20px;
}

.vk-cf-field textarea:focus + label,
.vk-cf-field textarea:not(:placeholder-shown) + label,
.vk-cf-field textarea.has-content + label {
  top: 8px;
}

/* Error state for floating labels */
.input-error {
  border-bottom-color: #f44336 !important;
  background-color: #ffebee !important;
}

.input-error + label {
  color: #f44336 !important;
}

/* File input styling - non-floating */
.vk-cf-field.file-field {
  margin-bottom: 20px;
}

.vk-cf-field.file-field label {
  position: static;
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
  color: #424242;
  letter-spacing: 0.25px;
  transform: none;
}

/* Material Design Floating Label Text Fields */
.vk-cf-field {
  position: relative;
  margin-bottom: 24px;
}

.vk-cf-field input[type="text"],
.vk-cf-field input[type="email"],
.vk-cf-field textarea {
  width: 100%;
  padding: 20px 16px 8px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px 4px 0 0;
  font-size: 16px;
  line-height: 1.5;
  /*background-color: #f5f5f5;*/
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  border-bottom: 2px solid #e0e0e0;
}

.vk-cf-field input[type="text"]:focus,
.vk-cf-field input[type="email"]:focus,
.vk-cf-field textarea:focus {
  outline: none;
  border-bottom-color: #1976d2;
  /*background-color: #fafafa;*/
  box-shadow: none;
}

/* Floating Labels */
.vk-cf-field label {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 16px;
  color: #757575;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  z-index: 1;
  transform-origin: left center;
  margin: 0;
  font-weight: 400;
}

/* Float the label when input is focused or has content */
.vk-cf-field input:focus + label,
.vk-cf-field input:not(:placeholder-shown) + label,
.vk-cf-field input.has-content + label,
.vk-cf-field textarea:focus + label,
.vk-cf-field textarea:not(:placeholder-shown) + label,
.vk-cf-field textarea.has-content + label {
  top: 4px;
  left: 16px;
  font-size: 12px;
  color: #1976d2;
  font-weight: 500;
  transform: scale(0.85);
}

/* Label for focused state */
.vk-cf-field input:focus + label,
.vk-cf-field textarea:focus + label {
  color: #1976d2;
}

/* Required asterisk styling */
.vk-cf-field label .vk-cf-required {
  color: #f44336;
  margin-left: 2px;
  font-size: 14px;
}

.vk-cf-field textarea {
  min-height: 80px;
  resize: vertical;
}

/* Material Design File Input */
.vk-cf-field input[type="file"] {
  width: 100%;
  padding: 16px;
  border: 2px dashed #e0e0e0;
  border-radius: 4px;
  /*background-color: #fafafa;*/
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.vk-cf-field input[type="file"]:hover {
  border-color: #bdbdbd;
  /*background-color: #f5f5f5;*/
}

.vk-cf-field input[type="file"]:focus {
  outline: none;
  border-color: #1976d2;
  /*background-color: #ffffff;*/
}

/* Material Design Button */
.vk-cf-field button[type='submit'] {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(45deg, #1976d2, #1565c0);
  color: white;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.vk-cf-field button[type='submit']:hover {
  background: linear-gradient(45deg, #1565c0, #0d47a1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.vk-cf-field button[type='submit']:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vk-cf-field button[type='submit']:disabled {
  background: #e0e0e0;
  color: #9e9e9e;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Material Design Required Indicator */
.vk-cf-required {
  color: #f44336;
  margin-left: 4px;
  font-weight: 400;
}

/* Material Design Error States */
.vk-cf-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  /*letter-spacing: 0.4px;*/
}

.input-error {
  border-color: #f44336 !important;
  background-color: #ffebee !important;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2) !important;
}

/* Material Design Success/Info Messages */
.vk-cf-form-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vk-cf-form-message.success {
  background-color: #e8f5e8;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

.vk-cf-form-message.error {
  background-color: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

/* Material Design Loading State */
.vk-cf-loading {
  display: inline-flex;
  align-items: center;
  color: #757575;
  font-size: 14px;
  margin-top: 8px;
}

.vk-cf-loading:before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top: 2px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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

/* Material Design Floating Labels (Optional Enhancement) */
.vk-cf-field.floating-label {
  position: relative;
  margin-top: 20px;
}

.vk-cf-field.floating-label label {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 16px;
  color: #757575;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: transparent;
  z-index: 1;
}

.vk-cf-field.floating-label input:focus + label,
.vk-cf-field.floating-label input:not(:placeholder-shown) + label,
.vk-cf-field.floating-label textarea:focus + label,
.vk-cf-field.floating-label textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 12px;
  font-size: 12px;
  color: #1976d2;
  background-color: white;
  padding: 0 4px;
}

/* Material Design Card Elevation */
.vk-cf-form:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .vk-cf-form {
    padding: 16px;
    margin: 8px;
  }

  .vk-cf-field input[type="text"],
  .vk-cf-field input[type="email"],
  .vk-cf-field textarea,
  .vk-cf-field input[type="file"] {
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Material Design Ripple Effect for Button */
.vk-cf-field button[type='submit']:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.vk-cf-field button[type='submit']:active:after {
  width: 300px;
  height: 300px;
}
