/**
 * GP Signup Request Modal - Styles
 * Version: 1.0.0
 * 
 * Matches GRIPAR login form design language
 */

/* ===========================
   MODAL OVERLAY
   =========================== */
.gp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gp-modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* Fade-in animation */
.gp-modal-overlay.entering {
    display: flex;
    opacity: 0;
}

/* ===========================
   MODAL CONTAINER
   =========================== */
.gp-modal-container {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gp-modal-overlay.show .gp-modal-container {
    transform: translateY(0) scale(1);
}

/* Custom scrollbar for modal */
.gp-modal-container::-webkit-scrollbar {
    width: 6px;
}

.gp-modal-container::-webkit-scrollbar-track {
    background: transparent;
}

.gp-modal-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

/* ===========================
   MODAL CARD
   =========================== */
.gp-modal-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 36px 32px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    position: relative;
}

/* ===========================
   CLOSE BUTTON
   =========================== */
.gp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #F3F4F6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    z-index: 1;
}

.gp-modal-close:hover {
    background: #E5E7EB;
    color: #374151;
    transform: rotate(90deg);
}

.gp-modal-close:focus {
    outline: 2px solid #5B6ABF;
    outline-offset: 2px;
}

.gp-modal-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ===========================
   MODAL HEADER
   =========================== */
.gp-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.gp-modal-icon {
    width: 52px;
    height: 52px;
    background: rgba(91, 106, 191, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #5B6ABF;
}

.gp-modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2D3748;
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.3;
}

.gp-modal-subtitle {
    color: #6B7280;
    font-size: 14px;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* ===========================
   SUCCESS STATE
   =========================== */
.gp-modal-success {
    text-align: center;
    padding: 20px 0;
}

.gp-modal-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.gp-modal-success-icon svg {
    width: 100%;
    height: 100%;
}

.gp-modal-success-icon circle {
    fill: #48BB78;
    opacity: 0.15;
}

.gp-modal-success-icon path {
    stroke: #48BB78;
    stroke-width: 3;
    fill: none;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: gp-checkmark 0.5s ease-out 0.2s forwards;
}

.gp-modal-success h4 {
    font-size: 20px;
    font-weight: 600;
    color: #2D3748;
    margin: 0 0 10px 0;
}

.gp-modal-success p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    line-height: 1.6;
}

/* ===========================
   MODAL FORM
   =========================== */
.gp-modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gp-modal-form .gp-form-label {
    text-align: left;
}

/* ===========================
   TEXTAREA
   =========================== */
.gp-form-textarea {
    height: auto !important;
    min-height: 80px;
    padding: 14px 20px !important;
    resize: vertical;
    line-height: 1.5 !important;
    font-family: inherit;
    border-radius: 12px !important;
}

.gp-char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 4px;
}

.gp-char-count.near-limit {
    color: #F59E0B;
}

.gp-char-count.at-limit {
    color: #EF4444;
}

/* ===========================
   SELECT DROPDOWN
   =========================== */
.gp-select-wrapper {
    position: relative;
}

.gp-form-select {
    cursor: pointer;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 44px !important;
    background-image: none !important;
}

.gp-select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================
   MODAL FORM OVERRIDES (Blocksy compat)
   =========================== */
.gp-modal-card .gp-form-input,
.gp-modal-card input[type="email"],
.gp-modal-card input[type="text"],
.gp-modal-card textarea,
.gp-modal-card select {
    width: 100% !important;
    height: 48px !important;
    padding: 0 20px !important;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 9999px !important;
    font-size: 15px !important;
    background: #FFFFFF !important;
    color: #2D3748 !important;
    box-shadow: none !important;
    line-height: 48px !important;
    margin: 0 !important;
}

.gp-modal-card textarea.gp-form-input,
.gp-modal-card textarea {
    height: auto !important;
    min-height: 80px !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    line-height: 1.5 !important;
}

.gp-modal-card select.gp-form-input,
.gp-modal-card select {
    border-radius: 9999px !important;
}

.gp-modal-card .gp-form-input:focus,
.gp-modal-card input:focus,
.gp-modal-card textarea:focus,
.gp-modal-card select:focus {
    border-color: #5B6ABF !important;
    box-shadow: 0 0 0 3px rgba(91, 106, 191, 0.12) !important;
    outline: none !important;
}

.gp-modal-card .gp-submit-btn {
    background: #5B6ABF !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 9999px !important;
    height: 48px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    width: 100% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(91, 106, 191, 0.25) !important;
    line-height: 48px !important;
    padding: 0 24px !important;
    margin-top: 4px !important;
}

.gp-modal-card .gp-submit-btn:hover:not(:disabled) {
    background: #4A59A8 !important;
    box-shadow: 0 4px 12px rgba(91, 106, 191, 0.35) !important;
}

.gp-modal-card .gp-form-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6B7280 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* OTP Step Overrides (Blocksy compat) */
.gp-otp-step .gp-form-input,
.gp-otp-step input[type="text"] {
    width: 100% !important;
    height: 48px !important;
    padding: 0 20px !important;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 9999px !important;
    font-size: 22px !important;
    background: #FFFFFF !important;
    color: #2D3748 !important;
    box-shadow: none !important;
    line-height: 48px !important;
    margin: 0 !important;
    text-align: center !important;
    letter-spacing: 8px !important;
    font-weight: 600 !important;
    font-family: 'Courier New', monospace !important;
}

.gp-otp-step .gp-form-input:focus,
.gp-otp-step input[type="text"]:focus {
    border-color: #5B6ABF !important;
    box-shadow: 0 0 0 3px rgba(91, 106, 191, 0.12) !important;
    outline: none !important;
}

.gp-otp-step .gp-submit-btn {
    background: #5B6ABF !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 9999px !important;
    height: 48px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    width: 100% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(91, 106, 191, 0.25) !important;
    line-height: 48px !important;
    padding: 0 24px !important;
    margin-top: 16px !important;
}

.gp-otp-step .gp-submit-btn:hover:not(:disabled) {
    background: #4A59A8 !important;
    box-shadow: 0 4px 12px rgba(91, 106, 191, 0.35) !important;
}

.gp-otp-step .gp-form-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6B7280 !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gp-otp-step .gp-error-message {
    margin-bottom: 16px;
}

/* ===========================
   OTP VERIFICATION STEP
   =========================== */
.gp-otp-step {
    animation: gp-fadeIn 0.3s ease;
}

@keyframes gp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gp-otp-header {
    text-align: center;
    margin-bottom: 24px;
}

.gp-otp-icon {
    width: 52px;
    height: 52px;
    background: rgba(91, 106, 191, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #5B6ABF;
}

.gp-otp-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2D3748;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.gp-otp-header p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

.gp-otp-header strong {
    color: #2D3748;
    word-break: break-all;
}

/* OTP Status Message */
.gp-otp-status {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    min-height: 20px;
}

/* OTP Footer — Timer + Resend + Back */
.gp-otp-footer {
    margin-top: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gp-otp-timer {
    font-size: 13px;
    color: #9CA3AF;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.gp-otp-resend {
    font-size: 14px;
    font-weight: 600;
    color: #5B6ABF !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.2s ease;
}

.gp-otp-resend:hover {
    color: #4A59A8 !important;
    text-decoration: underline !important;
}

.gp-otp-separator {
    color: #D1D5DB;
    font-size: 14px;
    user-select: none;
}

.gp-otp-back {
    font-size: 14px;
    font-weight: 500;
    color: #6B7280 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.2s ease;
}

.gp-otp-back:hover {
    color: #5B6ABF !important;
    text-decoration: underline !important;
}

/* OTP input styling — reuses .gp-mfa-input from parent CSS */
.gp-otp-step .gp-mfa-input {
    text-align: center;
    font-size: 22px;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ===========================
   REFERRAL "OTHER" SPECIFY FIELD
   =========================== */
.gp-referral-other-wrapper {
    margin-top: 10px;
}

/* ===========================
   SIGNUP TRIGGER LINK EMPHASIS
   =========================== */
.gp-signup-trigger {
    font-weight: 600 !important;
    position: relative;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .gp-modal-overlay {
        padding: 16px;
        align-items: flex-end;
    }
    
    .gp-modal-container {
        max-height: 85vh;
    }
    
    .gp-modal-card {
        padding: 28px 24px 24px;
        border-radius: 16px 16px 0 0;
    }
}

@media (max-width: 480px) {
    .gp-modal-card {
        padding: 24px 20px 20px;
    }
    
    .gp-modal-header h3 {
        font-size: 20px;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */
@media (prefers-reduced-motion: reduce) {
    .gp-modal-overlay,
    .gp-modal-container {
        transition-duration: 0.01ms !important;
    }
    
    .gp-modal-success-icon path {
        animation-duration: 0.01ms !important;
    }
}

/* ===========================
   STATUS CHECK — RESULT DISPLAY
   =========================== */
.gp-status-result {
    text-align: center;
    padding: 8px 0 24px;
    animation: gp-fadeIn 0.3s ease;
}

.gp-status-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.gp-status-badge-icon {
    font-size: 32px;
    line-height: 1;
}

.gp-status-result-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.gp-status-result-email {
    font-size: 14px;
    color: #2D3748;
    font-weight: 600;
    margin: 0 0 4px 0;
    word-break: break-all;
}

.gp-status-result-date {
    font-size: 13px;
    color: #9CA3AF;
    margin: 0 0 20px 0;
}

.gp-status-result-message {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
    padding: 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
}

.gp-status-done-btn {
    margin-top: 20px;
}

/* ===========================
   STATUS CHECK — BLOCKSY OVERRIDES
   =========================== */
#gp-status-modal .gp-form-input,
#gp-status-modal input[type="email"],
#gp-status-modal input[type="text"] {
    width: 100% !important;
    height: 48px !important;
    padding: 0 20px !important;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 9999px !important;
    font-size: 15px !important;
    background: #FFFFFF !important;
    color: #2D3748 !important;
    box-shadow: none !important;
    line-height: 48px !important;
    margin: 0 !important;
}

#gp-status-modal .gp-form-input:focus,
#gp-status-modal input[type="email"]:focus,
#gp-status-modal input[type="text"]:focus {
    border-color: #5B6ABF !important;
    box-shadow: 0 0 0 3px rgba(91, 106, 191, 0.12) !important;
    outline: none !important;
}

#gp-status-modal .gp-mfa-input {
    text-align: center !important;
    font-size: 22px !important;
    letter-spacing: 8px !important;
    font-weight: 600 !important;
    font-family: 'Courier New', monospace !important;
}

#gp-status-modal .gp-submit-btn {
    background: #5B6ABF !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 9999px !important;
    height: 48px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    width: 100% !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(91, 106, 191, 0.25) !important;
    line-height: 48px !important;
    padding: 0 24px !important;
}

#gp-status-modal .gp-submit-btn:hover:not(:disabled) {
    background: #4A59A8 !important;
    box-shadow: 0 4px 12px rgba(91, 106, 191, 0.35) !important;
}

#gp-status-modal .gp-form-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6B7280 !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
}