/**
 * Modern UI CSS for WooCommerce Confirm Payment
 */

/* Main Container */
.wcp-modern-ui {
  background: #ffffff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f2f5;
  max-width: 800px;
  margin: 0 auto 40px;
  font-family: inherit;
}

.wcp-form {
  -webkit-transition: opacity .3s ease;
  transition: opacity .3s ease;
}

.wcp-form.is-loading {
  opacity: .6;
  pointer-events: none;
}

.wcp-form-inner {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.wcp-form-group {
  position: relative;
  width: 100%;
  padding-right: 10px;
  padding-left: 10px;
  margin-bottom: 20px;
}

.wcp-col-12 {
  width: 100%;
}

@media (min-width: 768px) {
  .wcp-col-2 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Labels */
.wcp-form-label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 14px;
}

.wcp-form-label .required {
  color: #e53e3e;
  margin-left: 3px;
}

/* Inputs */
.wcp-form-control {
  width: 100%;
  line-height: 1.5;
  height: auto;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  color: #2d3748;
  transition: all 0.2s ease-in-out;
  font-size: 15px;
}

.wcp-form-control:focus {
  background: #ffffff;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
  outline: none;
}

.wcp-readonly {
  background-color: #edf2f7;
  cursor: not-allowed;
  color: #718096;
}

/* Bank Selection Cards */
.wcp-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 5px;
}

.wcp-bank-option {
  margin: 0;
  cursor: pointer;
}

.wcp-hidden-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wcp-bank-card {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  transition: all 0.2s ease;
  position: relative;
}

.wcp-bank-option:hover .wcp-bank-card {
  border-color: #cbd5e0;
  background: #f8fafc;
}

/* Selected Bank State */
.wcp-hidden-radio:checked + .wcp-bank-card {
  border-color: #3182ce;
  background: #ebf8ff;
  box-shadow: 0 2px 4px rgba(49, 130, 206, 0.1);
}

.wcp-bank-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  margin-right: 12px;
  background: #fff;
  border: 1px solid #edf2f7;
}

.wcp-bank-details {
  display: flex;
  flex-direction: column;
}

.wcp-bank-name {
  font-weight: 600;
  color: #2d3748;
  font-size: 14px;
  line-height: 1.2;
}

.wcp-bank-acc {
  color: #718096;
  font-size: 12px;
  margin-top: 4px;
}

/* Check Icon */
.wcp-check-icon {
  position: absolute;
  right: 15px;
  color: #3182ce;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.wcp-hidden-radio:checked + .wcp-bank-card .wcp-check-icon {
  opacity: 1;
  transform: scale(1);
}

/* File Upload */
.wcp-file-upload-wrapper {
  position: relative;
}
.wcp-file-input {
  padding: 10px;
  background: #fff;
  border: 1px dashed #cbd5e0;
  cursor: pointer;
}
.wcp-file-input:hover {
  border-color: #a0aec0;
}

/* Submit Button */
.wcp-submit-group {
  margin-top: 10px;
  text-align: center;
}

.wcp-button-confirm {
  background-color: #3182ce !important;
  color: #ffffff !important;
  border: none !important;
  padding: 14px 30px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  width: 100%;
  max-width: 300px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 6px rgba(49, 130, 206, 0.2) !important;
}

.wcp-button-confirm:hover {
  background-color: #2b6cb0 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(49, 130, 206, 0.3) !important;
}

/* Loading Spinner */
.wcp-form.is-loading .wcp-button-confirm span {
  opacity: 0;
}
.wcp-form.is-loading .wcp-button-confirm:after {
  position: absolute;
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent !important;
  animation: wcp-load-spin 0.6s linear infinite;
}

/* Response Messages (Success / Error) */
.wcp-alert {
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
}
.has-error .wcp-alert {
  color: #c53030;
  background-color: #fff5f5;
  border-left: 4px solid #f56565;
}

.wcp-form-success-message {
  color: #276749;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.wcp-form-success-message p {
  margin: 0;
  font-weight: 500;
  font-size: 16px;
}

.checkmark {
  width: 40px;
  height: 40px;
  margin-right: 15px;
}

/* Animations */
@keyframes wcp-load-spin {
  100% { transform: rotate(360deg); }
}

.checkmark-path { stroke-dasharray: 1000; stroke-dashoffset: 0; }
.checkmark-path.circle { animation: wcp-dash 0.9s ease-in-out; }
.checkmark-path.check {
  stroke-dashoffset: -100;
  animation: wcp-dash-check 0.9s 0.35s ease-in-out forwards;
}

@keyframes wcp-dash { 0% { stroke-dashoffset: 1000; } 100% { stroke-dashoffset: 0; } }
@keyframes wcp-dash-check { 0% { stroke-dashoffset: -100; } 100% { stroke-dashoffset: 900; } }

/* Mobile Adjustments */
@media (max-width: 600px) {
  .wcp-modern-ui { padding: 20px 15px; }
  .wcp-bank-grid { grid-template-columns: 1fr; }
  .wcp-button-confirm { width: 100%; max-width: 100%; }
}