/**
 * Amelia Gift Cards Frontend Styles
 *
 * @package    AmeliaGiftCards
 * @since      1.0.0
 * @copyright  Copyright (c) 2024-2026 ameliagiftcards.com
 * @license    GPL-2.0-or-later
 */

/* Gift Card Form Styles */
.agc-gift-card-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.agc-gift-card-form * {
    box-sizing: border-box;
}

.agc-form-title {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.agc-form-description {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Form Loading State */
.agc-purchase-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.agc-submit-btn.loading {
    position: relative;
}

.agc-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: agc-spin 1s linear infinite;
}

/* Form Disabled State */
.agc-purchase-form.agc-payment-disabled {
    opacity: 0.7;
}

.agc-purchase-form.agc-payment-disabled .agc-submit-button.agc-disabled {
    background-color: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.agc-purchase-form.agc-payment-disabled .agc-submit-button.agc-disabled:hover {
    background-color: #ccc !important;
    border-color: #ccc !important;
    transform: none !important;
}

.agc-purchase-form.agc-payment-disabled .agc-form-error {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
}

@keyframes agc-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Custom validation classes (avoid Divi conflicts) */
.agc-valid-field {
    border-color: #00a32a !important;
    box-shadow: 0 0 0 1px #00a32a;
}

.agc-invalid-field {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638;
}

/* Responsive Design */
@media (max-width: 768px) {
    .agc-gift-card-form {
        padding: 20px 15px;
    }
    
    .agc-form-row-half {
        flex-direction: column;
        gap: 0;
    }
    
    .agc-form-col {
        margin-bottom: 20px;
    }
    
    .agc-form-title {
        font-size: 20px;
    }
}

/* Custom Amount Toggle */
.agc-amount-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.agc-amount-option {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.agc-amount-option:hover {
    border-color: #00a32a;
}

.agc-amount-option.selected {
    background: #00a32a;
    color: white;
    border-color: #00a32a;
}

.agc-amount-option.custom {
    border-style: dashed;
}

/* Payment Processing */
.agc-payment-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.agc-payment-methods {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.agc-payment-method {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
}

.agc-payment-method:hover {
    border-color: #00a32a;
}

.agc-payment-method.active {
    background: #00a32a;
    color: white;
    border-color: #00a32a;
}

.agc-payment-method img {
    max-height: 24px;
    width: auto;
}

/* Stripe Elements */
#agc-stripe-card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    margin-bottom: 20px;
}

.agc-stripe-errors {
    color: #d63638;
    font-size: 14px;
    margin-top: 10px;
}

/* Success/Error Messages */
.agc-message {
    animation: agc-slideIn 0.3s ease-out;
}

@keyframes agc-slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form always uses light background for readability (payment form) */
.agc-purchase-form.agc-gift-card-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ========================================
   Visual Redesign: Section Cards & Steps
   ======================================== */

/* Section Cards */
.agc-form-step {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px 24px;
    margin-bottom: 24px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.agc-form-step:hover {
    border-color: var(--agc-primary, #667eea);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Step Header */
.agc-step-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.agc-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, var(--agc-primary, #667eea), var(--agc-secondary, #764ba2));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Title alignment override inside step header */
.agc-step-header .agc-section-title {
    text-align: left;
    margin-bottom: 0;
    font-size: 20px;
}

/* Override standalone section paddings when inside form-step */
.agc-amount-selection.agc-form-step {
    max-width: none;
    margin: 0 0 24px 0;
}

.agc-message-section.agc-form-step {
    max-width: none;
    margin: 0 0 24px 0;
    padding: 28px 24px;
}

.agc-recipient-section.agc-form-step {
    max-width: none;
    margin: 0 0 24px 0;
}

/* Custom Amount Toggle - More Visible (higher specificity to override base) */
.agc-form-step .agc-toggle-custom-amount {
    border: 2px dashed var(--agc-primary, #667eea);
    color: var(--agc-primary, #667eea);
    font-weight: 600;
    background: #fff;
}

.agc-form-step .agc-toggle-custom-amount:hover {
    background: rgba(102, 126, 234, 0.08);
    border-style: solid;
    border-color: var(--agc-primary, #667eea);
    color: var(--agc-primary, #667eea);
}

/* Amount Buttons - Enhanced Depth */
.agc-form-step .agc-amount-btn {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.agc-form-step .agc-amount-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.agc-form-step .agc-amount-btn.agc-amount-btn-active {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Inputs - Premium Feel */
.agc-form-step .agc-input {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.agc-form-step .agc-input:focus {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.agc-form-step .agc-message-textarea {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    background: #fff;
}

.agc-form-step .agc-message-textarea:focus {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Input Group for Currency Prefix */
.agc-input-group {
    display: flex;
    align-items: center;
    position: relative;
}

.agc-currency-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    background: #e5e7eb;
    border: 2px solid #d1d5db;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.agc-input-group input[type="number"] {
    border-radius: 0 6px 6px 0;
}

/* Responsive Mobile for Redesign */
@media (max-width: 768px) {
    .agc-form-step {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 10px;
    }

    .agc-step-number {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 14px;
    }

    .agc-step-header .agc-section-title {
        font-size: 17px;
    }

    .agc-step-header {
        gap: 10px;
        margin-bottom: 16px;
    }
}

/* Print Styles */
@media print {
    .agc-gift-card-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .agc-submit-btn {
        display: none;
    }
}

/* ========================================
   WordPress Shortcode Specific Styles
   ======================================== */

/* WordPress Form Container */
.agc-wordpress-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.agc-wordpress-form .agc-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.agc-wordpress-form .agc-form-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.agc-wordpress-form .agc-form-description {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Field Styling for WordPress */
.agc-wordpress-form .agc-field-wrapper {
    margin-bottom: 20px;
}

.agc-wordpress-form .agc-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9rem;
}

.agc-wordpress-form .agc-required {
    color: #e74c3c;
    font-weight: bold;
}

.agc-wordpress-form .agc-field-input,
.agc-wordpress-form .agc-field-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: #fff;
}

.agc-wordpress-form .agc-field-input:focus,
.agc-wordpress-form .agc-field-textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.agc-wordpress-form .agc-field-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Amount Selection for WordPress */
.agc-wordpress-form .agc-amount-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.agc-wordpress-form .agc-amount-btn {
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.agc-wordpress-form .agc-amount-btn:hover {
    border-color: #007cba;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.agc-wordpress-form .agc-amount-btn.agc-amount-btn-active {
    background: #007cba;
    color: white;
    border-color: #007cba;
    transform: translateY(-1px);
}

.agc-wordpress-form .agc-custom-amount-wrapper {
    margin-top: 15px;
    display: none;
}

.agc-wordpress-form .agc-custom-amount-wrapper.active {
    display: block;
}

/* Form Actions for WordPress */
.agc-wordpress-form .agc-form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.agc-wordpress-form .agc-submit-button {
    background: linear-gradient(135deg, #007cba 0%, #005a8b 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.2);
}

.agc-wordpress-form .agc-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
}

.agc-wordpress-form .agc-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.agc-wordpress-form .agc-button-loading {
    display: none;
}

.agc-wordpress-form .agc-submit-button.loading .agc-button-text {
    display: none;
}

.agc-wordpress-form .agc-submit-button.loading .agc-button-loading {
    display: inline;
}

/* Success Message for WordPress */
.agc-wordpress-form .agc-success-wrapper {
    margin-top: 30px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Messages for WordPress */
.agc-wordpress-form .agc-form-messages {
    margin-bottom: 25px;
}

.agc-wordpress-form .agc-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

.agc-wordpress-form .agc-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.agc-wordpress-form .agc-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.agc-wordpress-form .agc-message.info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    color: #0056b3;
}

/* Balance and Status Checkers */
.agc-balance-checker,
.agc-status-checker {
    max-width: 400px;
    margin: 25px auto;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.agc-balance-checker h3,
.agc-status-checker h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
}

.agc-balance-form,
.agc-status-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.agc-balance-input,
.agc-status-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.agc-balance-input:focus,
.agc-status-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.agc-balance-button,
.agc-status-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.agc-balance-button:hover,
.agc-status-button:hover {
    background: #005a8b;
}

.agc-balance-result,
.agc-status-result {
    min-height: 30px;
    border-radius: 4px;
}

.agc-balance-result .agc-success,
.agc-status-result .agc-success {
    color: #155724;
    background: #d4edda;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    font-weight: 500;
}

.agc-balance-result .agc-error,
.agc-status-result .agc-error {
    color: #721c24;
    background: #f8d7da;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    font-weight: 500;
}

.agc-balance-result .agc-warning,
.agc-status-result .agc-warning {
    color: #856404;
    background: #fff3cd;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
    font-weight: 500;
}

/* Validation States for WordPress */
.agc-wordpress-form .agc-field-wrapper.agc-has-error .agc-field-input,
.agc-wordpress-form .agc-field-wrapper.agc-has-error .agc-field-textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.agc-wordpress-form .agc-field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 8px;
    display: block;
    font-weight: 500;
}

.agc-wordpress-form .agc-valid-field {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.agc-wordpress-form .agc-invalid-field {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Responsive Design for WordPress */
@media (max-width: 768px) {
    .agc-wordpress-form {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .agc-wordpress-form .agc-form-title {
        font-size: 1.5rem;
    }
    
    .agc-wordpress-form .agc-amount-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .agc-wordpress-form .agc-amount-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .agc-wordpress-form .agc-submit-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .agc-balance-form,
    .agc-status-form {
        flex-direction: column;
    }
    
    .agc-balance-button,
    .agc-status-button {
        margin-top: 10px;
        width: 100%;
    }
    
    .agc-balance-checker,
    .agc-status-checker {
        margin: 20px 10px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .agc-wordpress-form .agc-amount-buttons {
        grid-template-columns: 1fr;
    }
    
    .agc-wordpress-form .agc-form-title {
        font-size: 1.3rem;
    }
    
    .agc-success-final {
        padding: 20px !important;
        font-size: 14px !important;
    }
    
    .agc-success-final h2 {
        font-size: 18px !important;
    }
}

/* ========================================
   Story 2.2: Amount Selection Styles
   Mobile-First Responsive Design
   ======================================== */

/* Amount Selection Section (Task 4) */
.agc-amount-selection {
    padding: 20px;
}

.agc-section-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Amount Buttons Grid (AC1 - Responsive) */
.agc-amount-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.agc-amount-btn {
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--agc-primary, #667eea);
    background: white;
    border: 2px solid var(--agc-primary, #667eea);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 44px; /* AC: Touch target ≥44px for mobile accessibility */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-amount-btn:hover {
    background: #f0f4ff;
}

.agc-amount-btn:focus {
    outline: 2px solid var(--agc-primary, #667eea);
    outline-offset: 2px;
}

.agc-amount-btn.agc-amount-btn-active {
    background: linear-gradient(135deg, var(--agc-primary, #667eea), var(--agc-secondary, #764ba2));
    color: white;
    border-color: var(--agc-primary, #667eea);
}

/* Custom Amount Toggle (AC3) */
.agc-custom-toggle {
    margin-bottom: 15px;
}

.agc-toggle-custom-amount {
    display: block;
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px dashed #9ca3af;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 44px; /* AC: Touch target ≥44px */
}

.agc-toggle-custom-amount:hover {
    border-color: var(--agc-primary, #667eea);
    color: var(--agc-primary, #667eea);
}

.agc-toggle-custom-amount:focus {
    outline: 2px solid var(--agc-primary, #667eea);
    outline-offset: 2px;
}

/* Custom Amount Input Wrapper (AC3) */
.agc-custom-amount-wrapper {
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid #d1d5db;
}

.agc-custom-amount-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-custom-amount-wrapper input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-custom-amount-wrapper input[type="number"]:focus {
    outline: none;
    border-color: var(--agc-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Error State (AC3 - Validation) */
.agc-custom-amount-wrapper.agc-has-error {
    border-color: #dc2626;
    background: #fef2f2;
}

.agc-custom-amount-wrapper.agc-has-error input[type="number"] {
    border-color: #dc2626;
}

.agc-field-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 5px;
    display: none;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-custom-amount-wrapper.agc-has-error .agc-field-error {
    display: block;
}

/* Responsive Mobile-First (AC4 - Breakpoint 768px) */
@media (max-width: 768px) {
    .agc-amount-buttons {
        grid-template-columns: 1fr 1fr; /* 2 columns on mobile */
        gap: 10px;
    }

    .agc-section-title {
        font-size: 20px;
    }

    .agc-amount-btn {
        padding: 12px 15px;
        font-size: 16px;
    }

    .agc-amount-selection {
        padding: 15px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .agc-amount-buttons {
        grid-template-columns: 1fr 1fr; /* Keep 2 columns even on very small screens */
    }

    .agc-section-title {
        font-size: 18px;
    }
}

/* ========================================
   Story 2.3: Message Personalization Styles
   Real-Time Preview Card
   ======================================== */

/* Message Section Container (Task 4.2) */
.agc-message-section {
    padding: 20px;
    margin: 20px 0 0 0;
}

.agc-message-container {
    display: block;
}

/* Message Input Wrapper (Task 4.3) */
.agc-message-input-wrapper {
    display: flex;
    flex-direction: column;
}

.agc-message-input-wrapper .agc-field-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-message-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.5;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    min-height: 120px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.agc-message-textarea:focus {
    outline: none;
    border-color: var(--agc-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Character Counter (Task 4.4) */
.agc-character-counter {
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.agc-character-counter.agc-counter-warning {
    color: #f59e0b; /* Orange - warning at 90%+ (180 chars) */
    font-weight: 600;
}

.agc-character-counter.agc-counter-limit-reached {
    color: #dc2626; /* Red - limit reached (200 chars) */
    font-weight: 700;
}

.agc-character-counter #agc-counter-value {
    font-weight: 700;
}

/* Helper Messages (Task 4.5) */
.agc-message-helper {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-message-helper.agc-helper-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.agc-message-helper.agc-helper-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.agc-message-helper.agc-helper-error {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

/* ========================================
   Story 2.4: Recipient Email Validation Styles
   ======================================== */

/* Recipient Section (Task 4.2) */
.agc-recipient-section {
    padding: 30px 20px;
}

.agc-form-group {
    margin-bottom: 25px;
}

.agc-label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-label-required {
    position: relative;
}

.agc-required-indicator {
    color: #dc2626;
    margin-left: 4px;
    font-weight: 700;
}

.agc-optional-badge {
    font-weight: 400;
    color: #6b7280;
    font-size: 14px;
    margin-left: 6px;
}

/* Input Wrapper with Validation Icon (Task 4.3) */
.agc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.agc-input {
    width: 100%;
    padding: 12px 45px 12px 15px; /* Right padding pour icon */
    font-size: 16px;
    font-family: inherit;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.agc-input:focus {
    outline: none;
    border-color: var(--agc-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.agc-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Validation Icon (Task 4.3) */
.agc-validation-icon {
    position: absolute;
    right: 15px;
    font-size: 18px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.agc-validation-icon:empty {
    opacity: 0;
}

.agc-icon-valid {
    opacity: 1;
}

.agc-icon-invalid {
    opacity: 1;
}

/* Validation States (Task 4.4) */
/* Valid State (green checkmark) */
.agc-input-wrapper.agc-valid .agc-input {
    border-color: #10b981;
}

.agc-input-wrapper.agc-valid .agc-input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Invalid State (red X + error border) */
.agc-input-wrapper.agc-invalid .agc-input,
.agc-input-wrapper.agc-empty .agc-input {
    border-color: #dc2626;
}

.agc-input-wrapper.agc-invalid .agc-input:focus,
.agc-input-wrapper.agc-empty .agc-input:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Neutral State (typing, no validation shown yet) */
.agc-input-wrapper.agc-neutral .agc-input {
    border-color: #d1d5db;
}

/* Help Text and Error Messages (Task 4.5) */
.agc-help-text {
    font-size: 14px;
    color: #6b7280;
    margin-top: 6px;
    margin-bottom: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-help-text-muted {
    font-style: italic;
    color: #9ca3af;
}

.agc-field-error {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agc-error-text {
    color: #991b1b;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-field-error::before {
    content: '⚠️';
    font-size: 16px;
}

/* Responsive Mobile (Task 4.6) */
@media (max-width: 768px) {
    .agc-recipient-section {
        padding: 20px 15px;
    }

    .agc-input {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    .agc-form-group {
        margin-bottom: 20px;
    }
}

/* ========================================
   Story 2.4: Continue Button & Validation Summary
   ======================================== */

/* Form Actions Container (Task 7.2) */
.agc-form-actions {
    padding: 30px 20px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.agc-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.agc-btn-primary {
    background: linear-gradient(135deg, var(--agc-primary, #667eea), var(--agc-secondary, #764ba2));
    color: white;
}

.agc-btn-large {
    padding: 18px 40px;
    font-size: 20px;
}

.agc-btn-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

/* Enabled State (Task 7.2) */
.agc-btn-enabled {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.agc-btn-enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.agc-btn-enabled:hover .agc-btn-icon {
    transform: translateX(5px);
}

.agc-btn-enabled:active {
    transform: translateY(0);
}

/* Disabled State (Task 7.2) */
.agc-btn-disabled,
.agc-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.agc-btn:disabled:hover {
    transform: none;
}

/* Validation Summary (Task 7.3) */
.agc-validation-summary {
    margin-top: 20px;
    padding: 15px 20px;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    text-align: left;
}

.agc-summary-text {
    color: #991b1b;
    font-weight: 600;
    margin: 0 0 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-validation-list {
    margin: 0;
    padding-left: 20px;
    color: #991b1b;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.agc-validation-list li {
    margin-bottom: 5px;
}

/* Responsive Mobile (Task 7.4) */
@media (max-width: 768px) {
    .agc-form-actions {
        padding: 20px 15px;
    }

    .agc-btn-large {
        width: 100%;
        justify-content: center;
        padding: 16px 30px;
        font-size: 18px;
    }
}
/* ============================================
   Story 2.5: Stripe Payment Section Styles
   ============================================ */

/* Payment Section Container */
.agc-payment-section {
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.agc-payment-section .agc-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Payment Summary */
.agc-payment-summary {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.agc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1rem;
}

.agc-summary-row:last-child {
    margin-bottom: 0;
}

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

.agc-summary-value {
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Stripe Card Element Wrapper */
.agc-stripe-card-wrapper {
    margin-bottom: 25px;
}

.agc-stripe-card-wrapper .agc-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 1rem;
}

.agc-required-indicator {
    color: #e74c3c;
    margin-left: 3px;
}

/* Stripe Elements Styling */
#agc-card-element {
    background: #ffffff;
    padding: 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#agc-card-element:hover {
    border-color: var(--agc-primary, #667eea);
}

#agc-card-element.StripeElement--focus {
    border-color: var(--agc-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#agc-card-element.StripeElement--invalid {
    border-color: #e74c3c;
}

#agc-card-element.StripeElement--complete {
    border-color: #28a745;
}

/* Card Errors */
#agc-card-errors {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 8px;
    min-height: 20px;
    display: none;
}

#agc-card-errors:not(:empty) {
    display: block;
}

/* Payment Actions */
.agc-payment-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Buttons */
.agc-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.agc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.agc-btn-primary {
    background: linear-gradient(135deg, var(--agc-primary, #667eea), var(--agc-secondary, #764ba2));
    color: white;
    flex: 1;
}

.agc-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.agc-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e8ed;
}

.agc-btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: var(--agc-primary, #667eea);
    color: var(--agc-primary, #667eea);
}

.agc-btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Loading State */
.agc-btn-loading {
    display: none;
}

.agc-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: agc-spin 1s linear infinite;
}

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

/* Security Badge */
.agc-security-badge {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
}

/* Success Message */
.agc-payment-success-message {
    background: #ffffff;
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.agc-success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 20px;
}

.agc-payment-success-message h3 {
    color: #28a745;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.agc-payment-success-message p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.agc-payment-details {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
    text-align: left;
}

.agc-payment-details p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
}

.agc-payment-details p:last-child {
    margin-bottom: 0;
}

/* Story 2.6: Gift Card Code Display */
.agc-code-display {
    background: linear-gradient(135deg, var(--agc-primary, #667eea) 0%, var(--agc-secondary, #764ba2) 100%);
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0;
    text-align: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.agc-code-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.agc-code-value {
    display: block;
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Story 2.6: Intermediate Loading Message */
.agc-intermediate-message {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 12px;
}

.agc-intermediate-message .agc-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: agc-spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.agc-intermediate-message p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Story 2.6: Critical Error Display */
.agc-critical-error {
    background: #fff5f5;
    border: 2px solid #e74c3c;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.agc-critical-error .agc-error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.agc-critical-error h3 {
    color: #e74c3c;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.agc-critical-error p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.agc-critical-error code {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e74c3c;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .agc-payment-section {
        padding: 20px;
        margin: 20px 0;
    }

    .agc-payment-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .agc-btn {
        width: 100%;
    }

    .agc-summary-row {
        font-size: 0.95rem;
    }

    .agc-summary-value {
        font-size: 1rem;
    }
}

/* Hide payment section by default (shown via JS) */
#agc-payment-section {
    display: none;
}
