/* ============================================================
   UNIT9 Policies System - Frontend Styles
   Matching NDA 2025 Design System
   ============================================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.u9ps-frontend {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #000000;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

/* === CONTAINER === */
.u9ps-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 640px) {
    .u9ps-container {
        padding: 0 16px;
    }
}

/* === HEADER === */
.u9ps-header {
    background: #000000;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #333;
}

.u9ps-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.u9ps-logo img {
    height: 40px;
    width: auto;
}

.u9ps-user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.u9ps-user-name {
    color: #ffffff;
    font-size: 14px;
}

.u9ps-logout-btn {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.3s ease;
}

.u9ps-logout-btn:hover {
    background: #c82333;
}

@media (max-width: 640px) {
    .u9ps-user-name {
        display: none;
    }
}

.u9ps-back-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.u9ps-back-link:hover {
    opacity: 0.7;
}

/* === WELCOME PAGE === */
.u9ps-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.u9ps-welcome-card {
    background: #ffffff;
    color: #000000;
    border-radius: 20px;
    padding: 48px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
    border: 2px solid #333;
}

@media (max-width: 640px) {
    .u9ps-welcome-card {
        padding: 32px 24px;
        border-radius: 15px;
    }
}

.u9ps-welcome-card .u9ps-logo {
    margin-bottom: 32px;
}

.u9ps-welcome-card .u9ps-logo img {
    height: 48px;
}

.u9ps-welcome-card h1 {
    font-size: 2.2em;
    font-weight: 300;
    margin-bottom: 8px;
    color: #000;
}

.u9ps-subtitle {
    color: #666666;
    font-size: 1.1em;
    margin-bottom: 32px;
    opacity: 0.9;
}

.u9ps-welcome-content p {
    margin-bottom: 24px;
    color: #333333;
    line-height: 1.5;
}

.u9ps-login-section {
    margin: 32px 0;
}

.u9ps-info-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}

.u9ps-info-box p {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

.u9ps-info-box strong {
    color: #333;
}

/* === BUTTONS === */
.u9ps-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.u9ps-button-primary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
}

.u9ps-button-primary:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.u9ps-button-secondary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.u9ps-button-secondary:hover {
    background: #ffffff;
    color: #000000;
}

.u9ps-button-large {
    padding: 16px 32px;
    font-size: 18px;
}

.u9ps-button:disabled {
    background: #aaa;
    border-color: #aaa;
    cursor: not-allowed;
    transform: none;
}

/* === MAIN CONTENT === */
.u9ps-main-content {
    padding: 40px 0 100px;
    min-height: calc(100vh - 200px);
}

/* === DASHBOARD === */
.u9ps-dashboard-header {
    background: #000000;
    color: #ffffff;
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid #333;
    border-radius: 15px 15px 0 0;
}

.u9ps-dashboard-header h1 {
    font-size: 2.2em;
    font-weight: 300;
    margin-bottom: 10px;
}

.u9ps-dashboard-header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.u9ps-dashboard-section {
    margin-bottom: 48px;
}

.u9ps-dashboard-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #ffffff;
}

/* === ALERTS === */
.u9ps-alert {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
}

.u9ps-alert h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.u9ps-alert p {
    margin: 0;
}

.u9ps-alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* === POLICIES GRID === */
.u9ps-policies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

@media (max-width: 640px) {
    .u9ps-policies-grid {
        grid-template-columns: 1fr;
    }
}

.u9ps-policy-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 24px;
    color: #000000;
    border: 2px solid #e5e5e5;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.05);
}

.u9ps-policy-card:hover {
    border-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.1);
}

.u9ps-policy-unsigned {
    border-color: #ffa500;
}

.u9ps-policy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.u9ps-policy-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.u9ps-policy-status {
    flex-shrink: 0;
}

.u9ps-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.u9ps-badge-success {
    background: #d4edda;
    color: #155724;
}

.u9ps-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.u9ps-policy-excerpt {
    color: #666666;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.u9ps-policy-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #999999;
    margin-bottom: 16px;
}

.u9ps-policy-actions {
    margin-top: 16px;
}

/* === POLICY VIEW === */
.u9ps-policy-container {
    max-width: 1000px;
}

.u9ps-policy-info {
    background: #ffffff;
    color: #000000;
    border-radius: 15px 15px 0 0;
    padding: 30px;
    border: 2px solid #333;
    border-bottom: none;
}

.u9ps-policy-info h1 {
    font-size: 2.2em;
    font-weight: 300;
    margin-bottom: 12px;
}

.u9ps-pdf-viewer {
    background: #ffffff;
    padding: 24px;
    border-left: 2px solid #333;
    border-right: 2px solid #333;
}

.u9ps-pdf-iframe {
    width: 100%;
    height: 800px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    user-select: none;
}

@media (max-width: 640px) {
    .u9ps-pdf-iframe {
        height: 600px;
    }
}

.u9ps-signature-section {
    margin-bottom: 48px;
}

.u9ps-signature-card {
    background: #000000;
    color: #ffffff;
    border-radius: 0 0 15px 15px;
    padding: 40px;
    border: 2px solid #333;
    border-top: none;
}

.u9ps-signature-card h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.u9ps-signature-card p {
    margin-bottom: 24px;
    color: #cccccc;
    line-height: 1.6;
}

.u9ps-signature-card.u9ps-signed {
    background: #000000;
    border-color: #28a745;
}

.u9ps-signature-card.u9ps-signed h3 {
    color: #28a745;
}

.u9ps-signature-details {
    font-size: 12px !important;
    color: #888888 !important;
    text-align: center;
}

/* === MESSAGES === */
.u9ps-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 16px;
    font-weight: 500;
}

.u9ps-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.u9ps-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.u9ps-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* === ERROR PAGE === */
.u9ps-error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.u9ps-error-card {
    background: #ffffff;
    color: #000000;
    border-radius: 20px;
    padding: 48px;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
    border: 2px solid #333;
}

.u9ps-error-icon {
    color: #dc3545;
    margin-bottom: 24px;
    font-size: 48px;
}

.u9ps-error-card h1 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 24px;
    color: #333;
}

.u9ps-error-message {
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 32px;
    border: 1px solid #f5c6cb;
}

.u9ps-error-help {
    text-align: left;
    margin-bottom: 32px;
}

.u9ps-error-help h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

.u9ps-error-help ul {
    list-style-position: inside;
    color: #666666;
}

.u9ps-error-help li {
    margin-bottom: 8px;
}

.u9ps-error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.u9ps-error-support {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.u9ps-error-support strong {
    color: #333;
}

/* === FOOTER === */
.u9ps-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.u9ps-footer-copyright {
    color: #ffffff;
    font-size: 14px;
}

.u9ps-footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
}

.u9ps-footer-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .u9ps-footer {
        padding: 12px 16px;
        font-size: 12px;
    }
}

/* === CARDS === */
.u9ps-card {
    background: #ffffff;
    color: #000000;
    border-radius: 15px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
    border: 2px solid #333;
}

/* === VERIFICATION FORM === */
.u9ps-verification-intro {
    text-align: center;
    margin-bottom: 24px;
    color: #cccccc;
}

.u9ps-verification-step {
    margin-bottom: 20px;
}

.u9ps-form-group {
    margin-bottom: 25px;
}

.u9ps-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 0.95em;
}

.u9ps-form-help {
    font-size: 14px;
    color: #999999;
    margin-bottom: 12px;
    line-height: 1.5;
}

.u9ps-form-hint {
    font-size: 13px;
    color: #888888;
    margin-top: 8px;
}

.u9ps-form-hint a {
    color: #ffffff;
    text-decoration: underline;
}

.u9ps-form-hint a:hover {
    opacity: 0.8;
}

.u9ps-input-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.u9ps-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #000000;
}

.u9ps-input:focus {
    outline: none;
    border-color: #000000;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.u9ps-code-input {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    max-width: 180px;
}

.u9ps-verified-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #d4edda;
    border-radius: 8px;
    margin-bottom: 20px;
}

.u9ps-verified-badge .u9ps-badge {
    font-size: 14px;
}

#u9ps-verified-email {
    color: #155724;
    font-weight: 500;
}

.u9ps-divider {
    border: none;
    border-top: 1px solid #333;
    margin: 24px 0;
}

.u9ps-checkbox-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.u9ps-checkbox-label {
    display: flex;
    gap: 12px;
    cursor: pointer;
    align-items: flex-start;
}

.u9ps-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    transform: scale(1.2);
}

.u9ps-checkbox-text {
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    text-align: justify;
}

#u9ps-sign-button {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 16px auto 0;
}

#u9ps-sign-button:disabled {
    background: #aaa;
    border-color: #aaa;
    cursor: not-allowed;
}

/* Responsive adjustments for verification form */
@media (max-width: 640px) {
    .u9ps-input-group {
        flex-direction: column;
    }
    
    .u9ps-input {
        min-width: 100%;
    }
    
    .u9ps-input-group .u9ps-button {
        width: 100%;
    }
    
    .u9ps-code-input {
        max-width: 100%;
    }
    
    .u9ps-verified-badge {
        flex-direction: column;
        text-align: center;
    }
    
    .u9ps-checkbox-group {
        padding: 15px;
    }
}

/* === RESPONSIVE === */
@media (min-width: 640px) and (max-width: 1023px) {
    .u9ps-policies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .u9ps-policies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
