/**
 * TISKON Client Portal - Frontend Styles
 * Branded with TISKON colors: Primary #1a1a2e, Accent #e94560
 */

/* CSS Variables */
:root {
    --tiskon-primary: #1a1a2e;
    --tiskon-primary-dark: #0f0f1a;
    --tiskon-accent: #e94560;
    --tiskon-accent-hover: #d63d56;
    --tiskon-success: #28a745;
    --tiskon-warning: #ffc107;
    --tiskon-danger: #dc3545;
    --tiskon-gray-100: #f8f9fa;
    --tiskon-gray-200: #e9ecef;
    --tiskon-gray-300: #dee2e6;
    --tiskon-gray-500: #6c757d;
    --tiskon-gray-700: #495057;
    --tiskon-gray-900: #212529;
    --tiskon-border-radius: 8px;
    --tiskon-transition: all 0.3s ease;
    --tiskon-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --tiskon-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Form Wrapper */
.tiskon-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    border-radius: var(--tiskon-border-radius);
    box-shadow: var(--tiskon-shadow);
}

.tiskon-form-wrapper h2 {
    margin: 0 0 30px;
    color: var(--tiskon-primary);
    font-size: 24px;
    text-align: center;
}

/* Form Fields */
.tiskon-field {
    margin-bottom: 20px;
}

.tiskon-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--tiskon-gray-700);
    font-size: 14px;
}

.tiskon-required {
    color: var(--tiskon-accent);
    margin-left: 2px;
}

.tiskon-input,
.tiskon-textarea,
.tiskon-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--tiskon-gray-300);
    border-radius: var(--tiskon-border-radius);
    background: #fff;
    transition: var(--tiskon-transition);
    font-family: inherit;
}

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

.tiskon-input::placeholder,
.tiskon-textarea::placeholder {
    color: var(--tiskon-gray-500);
}

.tiskon-textarea {
    resize: vertical;
    min-height: 100px;
}

.tiskon-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Password Field */
.tiskon-password-wrapper {
    position: relative;
}

.tiskon-password-wrapper .tiskon-input {
    padding-right: 50px;
}

.tiskon-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--tiskon-gray-500);
    transition: var(--tiskon-transition);
}

.tiskon-password-toggle:hover {
    color: var(--tiskon-primary);
}

.tiskon-eye-icon::before {
    content: "👁";
    font-size: 18px;
}

.tiskon-eye-icon.hidden::before {
    content: "🙈";
}

/* Checkbox and Radio */
.tiskon-checkbox-label,
.tiskon-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--tiskon-gray-700);
    cursor: pointer;
    line-height: 1.5;
    margin-bottom: 8px;
}

.tiskon-checkbox-label input,
.tiskon-radio-label input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--tiskon-primary);
    cursor: pointer;
}

.tiskon-checkbox-group,
.tiskon-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Field Help Text */
.tiskon-field-help {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--tiskon-gray-500);
}

/* Field Header */
.tiskon-field-type-header {
    margin: 30px 0 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tiskon-gray-200);
}

.tiskon-field-type-header:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.tiskon-field-header {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: var(--tiskon-primary);
}

.tiskon-field-type-header .tiskon-field-description {
    margin: 0;
    color: var(--tiskon-gray-500);
    font-size: 14px;
}

/* File Upload */
.tiskon-file-upload {
    position: relative;
}

.tiskon-file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--tiskon-gray-300);
    border-radius: var(--tiskon-border-radius);
    background: var(--tiskon-gray-100);
    cursor: pointer;
    transition: var(--tiskon-transition);
}

.tiskon-file-input:hover {
    border-color: var(--tiskon-primary);
}

.tiskon-file-current {
    margin-top: 12px;
    padding: 12px;
    background: var(--tiskon-gray-100);
    border-radius: var(--tiskon-border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tiskon-file-preview {
    max-width: 100px;
    max-height: 80px;
    border-radius: 4px;
}

.tiskon-file-name {
    font-size: 13px;
    color: var(--tiskon-gray-700);
}

.tiskon-file-link {
    font-size: 13px;
    color: var(--tiskon-primary);
    text-decoration: none;
}

.tiskon-file-link:hover {
    text-decoration: underline;
}

/* File upload hint */
.tiskon-upload-hint {
    font-size: 12px;
    color: var(--tiskon-gray-500);
    margin-top: 6px;
}

/* File error (inline validation) */
.tiskon-file-error {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

/* Buttons */
.tiskon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--tiskon-border-radius);
    cursor: pointer;
    transition: var(--tiskon-transition);
    text-decoration: none;
    font-family: inherit;
}

.tiskon-button-primary {
    background: var(--tiskon-primary);
    color: #fff;
}

.tiskon-button-primary:hover {
    background: var(--tiskon-primary-dark);
    color: #fff;
}

.tiskon-button-accent {
    background: var(--tiskon-accent);
    color: #fff;
}

.tiskon-button-accent:hover {
    background: var(--tiskon-accent-hover);
}

.tiskon-button-outline {
    background: transparent;
    border: 2px solid var(--tiskon-primary);
    color: var(--tiskon-primary);
}

.tiskon-button-outline:hover {
    background: var(--tiskon-primary);
    color: #fff;
}

.tiskon-button-full {
    width: 100%;
}

.tiskon-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tiskon-button-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tiskon-button-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tiskon-spin 0.8s linear infinite;
}

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

/* Form Footer */
.tiskon-form-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--tiskon-gray-200);
    text-align: center;
    font-size: 14px;
    color: var(--tiskon-gray-500);
}

.tiskon-form-footer a {
    color: var(--tiskon-primary);
    text-decoration: none;
    font-weight: 500;
}

.tiskon-form-footer a:hover {
    text-decoration: underline;
}

/* Inline Fields */
.tiskon-field-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tiskon-forgot-link {
    font-size: 14px;
    color: var(--tiskon-gray-500);
    text-decoration: none;
}

.tiskon-forgot-link:hover {
    color: var(--tiskon-primary);
    text-decoration: underline;
}

/* Form Description */
.tiskon-form-description {
    margin-bottom: 20px;
    color: var(--tiskon-gray-500);
    font-size: 14px;
    line-height: 1.6;
}

/* Notices */
.tiskon-notice {
    padding: 16px 20px;
    border-radius: var(--tiskon-border-radius);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

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

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

.tiskon-notice-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

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

.tiskon-notice a {
    color: inherit;
    font-weight: 500;
}

/* Pending Notice */
.tiskon-pending-notice {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
}

.tiskon-pending-notice h3 {
    margin: 0 0 12px;
    font-size: 20px;
}

.tiskon-pending-notice p {
    margin: 0;
}

/* Form Messages */
.tiskon-form-messages {
    margin-bottom: 20px;
}

.tiskon-form-messages:empty {
    display: none;
}

/* Dashboard */
.tiskon-dashboard {
    max-width: 800px;
    margin: 0 auto;
}

.tiskon-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tiskon-gray-200);
}

.tiskon-dashboard-welcome h2 {
    margin: 0 0 8px;
    font-size: 28px;
    color: var(--tiskon-primary);
}

.tiskon-dashboard-welcome p {
    margin: 0;
    color: var(--tiskon-gray-500);
}

/* Progress Bar */
.tiskon-dashboard-progress {
    background: var(--tiskon-gray-100);
    padding: 20px;
    border-radius: var(--tiskon-border-radius);
    margin-bottom: 30px;
}

.tiskon-dashboard-progress h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tiskon-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tiskon-progress-bar {
    height: 8px;
    background: var(--tiskon-gray-300);
    border-radius: 4px;
    overflow: hidden;
}

.tiskon-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tiskon-primary), var(--tiskon-accent));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tiskon-progress-text {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--tiskon-gray-500);
}

/* Dashboard Sections */
.tiskon-dashboard-section {
    background: #fff;
    padding: 30px;
    border-radius: var(--tiskon-border-radius);
    box-shadow: var(--tiskon-shadow);
    margin-bottom: 30px;
}

.tiskon-dashboard-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: var(--tiskon-primary);
}

/* Profile Form in Dashboard */
.tiskon-dashboard .tiskon-form-wrapper {
    max-width: none;
    padding: 0;
    box-shadow: none;
}

/* Account Settings */
.tiskon-account-wrapper h3 {
    margin: 30px 0 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tiskon-gray-200);
    font-size: 18px;
    color: var(--tiskon-primary);
}

.tiskon-account-wrapper h3:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Logout Link */
.tiskon-logout-link {
    color: var(--tiskon-gray-500);
    text-decoration: none;
    font-size: 14px;
}

.tiskon-logout-link:hover {
    color: var(--tiskon-danger);
}

/* Responsive */
@media (max-width: 600px) {
    .tiskon-form-wrapper {
        padding: 24px;
        margin: 0 16px;
    }
    
    .tiskon-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tiskon-field-inline {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animation for form appearance */
@keyframes tiskon-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tiskon-form-wrapper {
    animation: tiskon-fadeIn 0.4s ease;
}
