/* ============================================================
   つり堀KINGバトル 2026 - 誓約書フォーム Stylesheet
   ============================================================ */

/* --- Pledge Page Layout --- */
#pledge-page {
    padding-top: 110px;
    padding-bottom: 80px;
    min-height: calc(100vh - 60px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--gold-light);
}

/* --- Pledge Document --- */
.pledge-document {
    background: var(--black-card);
    border: 1px solid var(--gray);
    border-radius: 10px;
    padding: 40px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.pledge-document::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

.pledge-doc-header {
    text-align: center;
    margin-bottom: 30px;
}

.pledge-date-display {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.pledge-doc-header h2 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.5em;
    color: var(--text-primary);
}

.pledge-body-text {
    margin-bottom: 30px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pledge-body-text p {
    font-size: 0.92rem;
    line-height: 2;
    color: var(--text-secondary);
    text-align: justify;
}

/* Event Info Table */
.pledge-event-info {
    background: rgba(212, 175, 55, 0.04);
    border-radius: 8px;
    padding: 4px;
}

.event-info-table {
    width: 100%;
    border-collapse: collapse;
}

.event-info-table th,
.event-info-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--gray);
    font-size: 0.95rem;
}

.event-info-table tr:last-child th,
.event-info-table tr:last-child td {
    border-bottom: none;
}

.event-info-table th {
    color: var(--gold-light);
    font-weight: 700;
    white-space: nowrap;
    width: 120px;
    font-size: 0.88rem;
    letter-spacing: 0.05em;
}

.event-info-table td {
    color: var(--text-primary);
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted) !important;
    font-weight: 400 !important;
}

/* --- Form --- */
.pledge-form {
    max-width: 750px;
    margin: 0 auto;
}

.form-section {
    background: var(--black-card);
    border: 1px solid var(--gray);
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.form-section:hover {
    border-color: rgba(212, 175, 55, 0.2);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray);
}

.form-section-title i {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Form Groups */
.form-group {
    margin-bottom: 22px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.required {
    display: inline-block;
    background: var(--red-bright);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-jp);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.04);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-input.error {
    border-color: var(--red-bright);
    background: rgba(230, 57, 70, 0.04);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-select option {
    background: var(--black-card);
    color: var(--text-primary);
}

.postal-input {
    max-width: 200px;
}

/* Date Inputs */
.date-inputs {
    display: flex;
    gap: 12px;
    align-items: center;
}

.date-inputs.compact {
    max-width: 300px;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-input-group .form-input {
    width: 100px;
    text-align: center;
}

.date-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Form Hints & Errors */
.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    display: block;
    font-size: 0.8rem;
    color: var(--red-bright);
    margin-top: 6px;
    min-height: 1.2em;
    font-weight: 500;
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    margin-top: 2px;
    position: relative;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--gold);
    border-color: var(--gold);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid var(--black);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Radio Button */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--gray-light);
    border-radius: 50%;
    margin-top: 2px;
    position: relative;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--gold);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
}

.form-section-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Media Notice */
.media-notice {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 18px;
}

.media-notice p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Signature Pad */
.signature-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.signature-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
}

.signature-title i {
    margin-right: 6px;
}

.signature-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.signature-pad-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.signature-pad-wrapper canvas {
    display: block;
    width: 100%;
    height: 150px;
    cursor: crosshair;
}

.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #bbb;
    font-size: 0.9rem;
    pointer-events: none;
    transition: opacity 0.3s;
}

.signature-placeholder.hidden {
    opacity: 0;
}

/* Signature Guide Message (appears after signing) */
.signature-guide {
    display: none;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(212, 175, 55, 0.12);
    border: 2px solid var(--gold);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold-light);
    text-align: center;
    animation: guideAppear 0.4s ease-out;
}

.signature-guide.visible {
    display: block;
}

.signature-guide i {
    margin-right: 6px;
    animation: bounceDown 1s ease-in-out infinite;
}

@keyframes guideAppear {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* Signature Locked Message */
.signature-locked-msg {
    margin-top: 10px;
    padding: 10px 16px;
    background: rgba(45, 143, 78, 0.12);
    border: 1px solid rgba(45, 143, 78, 0.4);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #4ecb71;
    text-align: center;
}

.signature-locked-msg i {
    margin-right: 6px;
}

.signature-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.btn-sig {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-sig-confirm {
    background: var(--gold);
    color: #000;
}

.btn-sig-confirm:hover {
    background: #F5D060;
    color: #000;
}

/* Pulsing highlight after user signs */
.btn-sig-confirm-pulse.active {
    padding: 12px 28px;
    font-size: 1rem;
    border-radius: 6px;
    animation: confirmPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5);
}

@keyframes confirmPulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.btn-sig-clear {
    background: var(--gray);
    color: var(--text-secondary);
}

.btn-sig-clear:hover {
    background: var(--gray-light);
    color: var(--text-primary);
}

/* Agreement Box */
.agreement-box {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.agreement-check span:last-child {
    font-weight: 700;
    color: var(--gold-light);
}

/* Cancel Notice */
.cancel-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.25);
    border-radius: 6px;
    padding: 16px 20px;
}

.cancel-notice i {
    color: var(--red-bright);
    font-size: 1.1rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.cancel-notice p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.cancel-notice strong {
    color: var(--red-bright);
}

/* Form Actions */
.form-actions {
    text-align: center;
    padding: 20px 0;
}

#submit-btn {
    min-width: 280px;
    font-size: 1.1rem;
    padding: 18px 40px;
}

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

/* --- Success Message --- */
.success-message {
    text-align: center;
    padding: 80px 20px;
    max-width: 550px;
    margin: 0 auto;
}

.success-icon {
    font-size: 4rem;
    color: #2d8f4e;
    margin-bottom: 24px;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.success-message h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--gold-light);
}

.success-message p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.success-note {
    font-size: 0.9rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 30px !important;
}

/* --- Pledge Footer --- */
#pledge-footer {
    background: var(--black);
    border-top: 1px solid var(--gray);
    padding: 24px 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #pledge-page {
        padding-top: 90px;
        padding-bottom: 50px;
    }

    .pledge-document {
        padding: 24px 18px;
    }

    .pledge-doc-header h2 {
        font-size: 1.3rem;
        letter-spacing: 0.3em;
    }

    .pledge-body-text {
        padding: 16px;
    }

    .pledge-body-text p {
        font-size: 0.85rem;
    }

    .event-info-table th,
    .event-info-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .event-info-table th {
        width: 90px;
    }

    .form-section {
        padding: 22px 18px;
    }

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

    .date-inputs {
        flex-wrap: wrap;
    }

    .date-input-group .form-input {
        width: 80px;
    }

    #submit-btn {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .pledge-date-display {
        font-size: 0.85rem;
    }

    .form-section-title {
        font-size: 1rem;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}
