/**
 * AuthFi Passkey Login - フロントエンド用CSS
 */

/* ウィジェット共通 */
.authfi-passkey-widget,
.authfi-passkey-register-widget {
    max-width: 400px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.authfi-passkey-widget h3,
.authfi-passkey-register-widget h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.authfi-passkey-register-widget h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: #333;
}

/* 入力フォーム */
.authfi-input-group {
    margin-bottom: 20px;
}

.authfi-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.authfi-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.authfi-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

/* パスキーボタン */
.authfi-passkey-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
}

.authfi-passkey-button:hover {
    background: linear-gradient(135deg, #135e96 0%, #0a4b78 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.35);
}

.authfi-passkey-button:active {
    transform: translateY(0);
}

.authfi-passkey-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.authfi-passkey-icon {
    width: 24px;
    height: 24px;
}

/* スピナー */
.authfi-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: authfi-spin 0.8s linear infinite;
}

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

/* ヒントテキスト */
.authfi-hint {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* メッセージ */
.authfi-message {
    margin-top: 15px;
}

.authfi-message p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 8px;
}

.authfi-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.authfi-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* 代替リンク */
.authfi-alternative {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.authfi-alternative a {
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
}

.authfi-alternative a:hover {
    text-decoration: underline;
}

/* ログイン済み */
.authfi-logged-in {
    text-align: center;
}

.authfi-logout-link {
    display: inline-block;
    margin-top: 10px;
    color: #dc2626;
    text-decoration: none;
}

.authfi-logout-link:hover {
    text-decoration: underline;
}

/* クレデンシャル一覧 */
.authfi-credentials-section {
    margin-bottom: 20px;
}

.authfi-credentials-list {
    margin-top: 10px;
}

.authfi-credential-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
}

.authfi-credential-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.authfi-credential-icon {
    width: 40px;
    height: 40px;
    color: #2271b1;
}

.authfi-credential-details {
    display: flex;
    flex-direction: column;
}

.authfi-credential-details strong {
    font-size: 14px;
    color: #1a1a1a;
}

.authfi-credential-meta {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.authfi-delete-btn {
    padding: 6px 12px;
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.authfi-delete-btn:hover {
    background: #dc2626;
    color: #fff;
}

.authfi-no-credentials {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f9fafb;
    border-radius: 8px;
}

/* 登録セクション */
.authfi-register-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.authfi-register-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.authfi-register-form .authfi-input {
    flex: 1;
}

.authfi-register-form .authfi-passkey-button {
    width: auto;
    flex-shrink: 0;
}

/* レスポンシブ */
@media screen and (max-width: 480px) {
    .authfi-passkey-widget,
    .authfi-passkey-register-widget {
        padding: 20px;
        margin: 10px;
    }
    
    .authfi-credential-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .authfi-delete-btn {
        align-self: flex-end;
    }
    
    .authfi-register-form {
        flex-direction: column;
    }
    
    .authfi-register-form .authfi-passkey-button {
        width: 100%;
    }
}
