/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.8s ease-in;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 60px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M50 20 L61 41 L83 44 L66 61 L71 83 L50 71 L29 83 L34 61 L17 44 L39 41 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hearts {
    margin-bottom: 20px;
    position: relative;
}

.hearts i {
    font-size: 24px;
    margin: 0 10px;
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

.hearts i:nth-child(2) {
    animation-delay: 0.2s;
    font-size: 32px;
}

.hearts i:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.subtitle {
    font-size: 18px;
    font-weight: 300;
    opacity: 0.95;
    position: relative;
}

/* Content */
.content {
    padding: 50px 40px;
}

.intro {
    text-align: center;
    margin-bottom: 50px;
}

.intro-text {
    font-size: 18px;
    color: #555;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
}

/* Agreement Cards */
.agreement-section {
    display: grid;
    gap: 30px;
    margin-bottom: 50px;
}

.agreement-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #667eea;
}

.agreement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.budget-card {
    border-left-color: #f5576c;
    background: linear-gradient(135deg, #fff5f7 0%, #ffffff 100%);
}

.icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
}

.icon-wrapper.birthday {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.icon-wrapper.special {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.icon-wrapper.budget {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.agreement-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.agreement-card p {
    font-size: 17px;
    color: #555;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.7;
}

.agreement-card strong {
    color: #667eea;
    font-weight: 600;
}

.amount {
    font-size: 32px;
    display: block;
    margin: 10px 0;
    color: #f5576c;
    font-family: 'Playfair Display', serif;
}

.note {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    text-align: center;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    margin-top: 15px;
}

/* Commitment Section */
.commitment {
    margin-bottom: 50px;
}

.commitment-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.commitment-box i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.commitment-box h3 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    margin-bottom: 15px;
}

.commitment-box p {
    font-size: 17px;
    line-height: 1.7;
    opacity: 0.95;
}

/* Signature Section */
.signature-section {
    text-align: center;
    padding: 30px 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.instruction {
    color: #666;
    font-size: 16px;
    margin-bottom: 40px;
}

.signature-pads {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

.signature-pad-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.pad-label {
    display: block;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: left;
}

.pad-label i {
    color: #667eea;
    margin-right: 8px;
}

.name-input {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-top: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Lato', sans-serif;
    transition: border-color 0.3s ease;
}

.name-input:focus {
    outline: none;
    border-color: #667eea;
}

.canvas-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.signature-canvas {
    width: 100%;
    height: 200px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    touch-action: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.signature-canvas.stamping {
    animation: stampEffect 0.4s ease;
}

@keyframes stampEffect {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(0.95) rotate(-2deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
    }
    75% {
        transform: scale(0.98) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
    }
}

.thumbprint-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #999;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.3s ease;
}

.thumbprint-instruction.hidden {
    opacity: 0;
}

.signature-saved {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    display: none;
    z-index: 10;
    animation: popIn 0.3s ease;
}

.signature-saved.show {
    display: block;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.canvas-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Lato', sans-serif;
}

.btn i {
    font-size: 14px;
}

.btn-clear {
    background: #f5f5f5;
    color: #666;
}

.btn-clear:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-save:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.signature-date {
    margin-top: 15px;
    font-size: 13px;
    color: #888;
    font-style: italic;
    min-height: 20px;
}

.hearts-divider-vertical {
    font-size: 32px;
    color: #f5576c;
    display: flex;
    align-items: center;
    animation: heartbeat 1.5s infinite;
}

.agreement-status {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
}

.status-message {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.status-message.pending {
    background: rgba(255, 152, 0, 0.1);
    color: #f57c00;
    border: 2px solid #f57c00;
}

.status-message.complete {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 2px solid #4caf50;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.status-message i {
    margin-right: 8px;
}

/* Footer */
.footer {
    background: #f5f7fa;
    padding: 30px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.footer i {
    color: #f5576c;
    animation: heartbeat 1.5s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    .header {
        padding: 40px 20px;
    }

    .header h1 {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .content {
        padding: 30px 20px;
    }

    .agreement-card {
        padding: 30px 20px;
    }

    .agreement-card h2 {
        font-size: 24px;
    }

    .signature-pads {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hearts-divider-vertical {
        display: none;
    }

    .signature-canvas {
        height: 180px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .header h1 {
        font-size: 28px;
    }

    .intro-text {
        font-size: 16px;
    }

    .agreement-card p {
        font-size: 16px;
    }

    .amount {
        font-size: 28px;
    }

    .signature-pad-container {
        padding: 20px 15px;
    }

    .signature-canvas {
        height: 150px;
    }

    .section-title {
        font-size: 26px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}