/* ========================================
   Forms Styles
   ======================================== */

.form-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.form-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.form-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.form-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* ========================================
   Form Sections
   ======================================== */

.form-section-title {
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
}

.form-section-title h3 {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
}

/* ========================================
   Form Groups
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.required {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 127, 90, 0.1);
}

select {
    cursor: pointer;
    background: var(--white);
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--gray);
}

/* ========================================
   Form Info
   ======================================== */

.form-info {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid #2196f3;
}

.form-info p {
    margin: 0;
    color: #1976d2;
}

/* ========================================
   Buttons
   ======================================== */

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

button[type="submit"] {
    cursor: pointer;
    border: none;
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Alerts
   ======================================== */

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #ffebee;
    border-left: 4px solid var(--danger);
    color: #c62828;
}

.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.alert li {
    margin: 0.5rem 0;
}

/* ========================================
   Success Card
   ======================================== */

.success-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: successPop 0.6s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-card h2 {
    color: var(--success);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.success-card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.success-link {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.success-link p {
    margin-bottom: 1rem;
    color: var(--dark);
}

.success-info {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    color: #856404;
    margin: 1.5rem 0;
}

/* ========================================
   reCAPTCHA Info
   ======================================== */

.recaptcha-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 1rem;
}

/* ========================================
   Loading State
   ======================================== */

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Validation States
   ======================================== */

input.invalid,
select.invalid {
    border-color: var(--danger);
}

input.valid,
select.valid {
    border-color: var(--success);
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

input.invalid + .error-message {
    display: block;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .form-card,
    .success-card {
        padding: 2rem 1.5rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .success-icon {
        font-size: 3rem;
    }
}

/* ========================================
   RTL Support
   ======================================== */

body[dir="rtl"] .form-info {
    border-left: none;
    border-right: 4px solid #2196f3;
}

body[dir="rtl"] .alert-error {
    border-left: none;
    border-right: 4px solid var(--danger);
}

body[dir="rtl"] .alert ul {
    padding-left: 0;
    padding-right: 1.5rem;
}

/* ========================================
   Success Page Styles
   ======================================== */

.success-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.success-animation {
    margin-bottom: 2rem;
}

.checkmark-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    margin: 0 auto;
    position: relative;
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.3);
}

.checkmark {
    width: 40px;
    height: 70px;
    border: solid white;
    border-width: 0 8px 8px 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
    opacity: 0;
}

.checkmark-circle.animate .checkmark {
    animation: checkmarkPop 0.6s 0.3s ease-out forwards;
}

@keyframes checkmarkPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) rotate(45deg) scale(0);
    }
    50% {
        transform: translate(-50%, -60%) rotate(45deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -60%) rotate(45deg) scale(1);
    }
}

.success-title {
    color: var(--success);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.deceased-card {
    background: var(--light);
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.deceased-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.deceased-card p {
    color: var(--gray);
    margin: 0;
}

.share-section {
    margin: 2rem 0;
}

.share-section p {
    font-weight: 600;
    margin-bottom: 1rem;
}

.url-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.url-box input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-family: monospace;
    background: var(--light);
}

.social-share {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20ba5a;
}

.btn-twitter {
    background: #1da1f2;
    color: white;
}

.btn-twitter:hover {
    background: #1a8cd8;
}

.btn-facebook {
    background: #4267B2;
    color: white;
}

.btn-facebook:hover {
    background: #365899;
}

.pending-info {
    background: #fff3cd;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    text-align: left;
}

body[dir="rtl"] .pending-info {
    text-align: right;
}

.pending-info h3 {
    color: #856404;
    margin-bottom: 1rem;
}

.pending-info ul {
    list-style-position: inside;
    color: #856404;
}

.pending-info li {
    margin: 0.5rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .url-box {
        flex-direction: column;
    }
    
    .social-share {
        flex-direction: column;
    }
    
    .social-share .btn {
        width: 100%;
    }
}
