/**
 * Public styles for Transaction Validation - Fraud Mitigation plugin
 * Color Scheme: #000000 (Black), #051441 (Navy Blue), #8BBB23 (Green)
 */

/* Login/Register Form Styles */
.tvfm-login-wrapper {
    max-width: 400px;
    margin: 20px auto;
    background: #fff;
    border: 2px solid #051441;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(5,20,65,0.1);
    overflow: hidden;
}

.tvfm-tabs {
    display: flex;
    background: #051441;
    border-bottom: 1px solid #051441;
}

.tvfm-tab-button {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    transition: all 0.3s ease;
}

.tvfm-tab-button:hover {
    background: rgba(141,187,9,0.2);
    color: #fff;
}

.tvfm-tab-button.active {
    background: #8BBB23;
    color: #051441;
}

.tvfm-tab-content {
    display: none;
    padding: 20px;
}

.tvfm-tab-content.active {
    display: block;
}

.tvfm-form {
    width: 100%;
}

.tvfm-field {
    margin-bottom: 20px;
}

.tvfm-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #051441;
}

.tvfm-field input[type="text"],
.tvfm-field input[type="email"],
.tvfm-field input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #051441;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.tvfm-field input[type="text"]:focus,
.tvfm-field input[type="email"]:focus,
.tvfm-field input[type="password"]:focus {
    outline: none;
    border-color: #8BBB23;
    box-shadow: 0 0 0 3px rgba(141,187,9,0.1);
}

.tvfm-field input.error {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.field-error {
    color: #000000;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.tvfm-submit-btn {
    width: 100%;
    padding: 12px;
    background: #8BBB23;
    color: #051441;
    border: 2px solid #8BBB23;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tvfm-submit-btn:hover {
    background: #051441;
    color: #fff;
    border-color: #051441;
}

.tvfm-submit-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

.tvfm-submit-btn.loading {
    position: relative;
}

.tvfm-submit-btn.loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #051441;
    border-radius: 50%;
    animation: tvfm-spin 1s linear infinite;
}

@keyframes tvfm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.tvfm-messages {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.tvfm-messages.success {
    background-color: rgba(141,187,9,0.1);
    border: 1px solid #8BBB23;
    color: #051441;
}

.tvfm-messages.error {
    background-color: rgba(0,0,0,0.05);
    border: 1px solid #000000;
    color: #000000;
}

.tvfm-messages.loading {
    background-color: rgba(5,20,65,0.1);
    border: 1px solid #051441;
    color: #051441;
}

/* Logout Form */
.tvfm-logout-wrapper {
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}

.tvfm-user-info {
    background: #fff;
    border: 2px solid #051441;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(5,20,65,0.1);
}

.tvfm-user-info p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #051441;
}

.tvfm-logout-btn {
    padding: 10px 20px;
    background: #000000;
    color: #fff;
    border: 2px solid #000000;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tvfm-logout-btn:hover {
    background: #051441;
    border-color: #051441;
}

/* Dashboard Styles */
.tvfm-dashboard-wrapper {
    background: #fff;
    border: 2px solid #051441;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(5,20,65,0.1);
    min-height: 400px;
}

.tvfm-dashboard-iframe-wrapper {
    background: #fff;
    border: 2px solid #051441;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(5,20,65,0.1);
}

.tvfm-dashboard-iframe {
    width: 100%;
    min-height: 600px;
    border: none;
    display: block;
}

/* Loading state */
.tvfm-loading {
    text-align: center;
    padding: 40px;
    color: #051441;
}

.tvfm-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8BBB23;
    border-radius: 50%;
    animation: tvfm-spin 1s linear infinite;
    margin-right: 10px;
}

/* Notice styles */
.tvfm-notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.tvfm-notice-success {
    background-color: rgba(141,187,9,0.1);
    border-left-color: #8BBB23;
    color: #051441;
}

.tvfm-notice-error {
    background-color: rgba(0,0,0,0.05);
    border-left-color: #000000;
    color: #000000;
}

.tvfm-notice-warning {
    background-color: rgba(141,187,9,0.15);
    border-left-color: #8BBB23;
    color: #051441;
}

.tvfm-notice-info {
    background-color: rgba(5,20,65,0.1);
    border-left-color: #051441;
    color: #051441;
}

/* Responsive design */
@media (max-width: 768px) {
    .tvfm-login-wrapper,
    .tvfm-logout-wrapper {
        max-width: 100%;
        margin: 10px;
    }
    
    .tvfm-tab-button {
        padding: 12px;
        font-size: 14px;
    }
    
    .tvfm-tab-content {
        padding: 15px;
    }
    
    .tvfm-dashboard-wrapper {
        margin: 10px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .tvfm-field input[type="text"],
    .tvfm-field input[type="email"],
    .tvfm-field input[type="password"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .tvfm-submit-btn {
        font-size: 16px;
    }
}

/* Print styles */
@media print {
    .tvfm-login-wrapper,
    .tvfm-logout-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .tvfm-submit-btn,
    .tvfm-logout-btn {
        background: #000 !important;
        color: #fff !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tvfm-field input[type="text"],
    .tvfm-field input[type="email"],
    .tvfm-field input[type="password"] {
        border: 2px solid #000;
    }
    
    .tvfm-submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tvfm-submit-btn,
    .tvfm-tab-button,
    .tvfm-field input {
        transition: none;
    }
    
    .tvfm-submit-btn.loading::after {
        animation: none;
    }
}
